From 78618ed1a8fd89f9338089c72cbcd7724238ba63 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 18 Jan 2017 14:16:48 -0800 Subject: [PATCH] more robust initialization, remove old func --- .bashrc | 10 ++++++++-- brc | 22 +++++----------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.bashrc b/.bashrc index 7db792c..d0c4b02 100644 --- a/.bashrc +++ b/.bashrc @@ -53,6 +53,12 @@ if [[ $SSH_CONNECTION ]] \ && [[ ! $BASH_LOGIN_SHELL == true ]]; then return else - source /etc/profile - source ~/brc + if [[ -r /etc/profile ]]; then + source /etc/profile + fi + _x=$(readlink -f $BASH_SOURCE) + _x=${_x%/*}/brc + if [[ -r $_x ]]; then + source $_x + fi fi diff --git a/brc b/brc index 69d54ad..a71a7c7 100644 --- a/brc +++ b/brc @@ -300,21 +300,6 @@ b() { c - } -bashrcpush () { - local startdir="$PWD" - cd ~ - for x in "$@"; do - ssh $x mkdir -p bin/distro-functions/src - tar cz bin/semi-private bin/distro-functions/src | ssh $x tar xz - done - cd $(mktemp -d) - command cp /a/c/repos/bash/!(.git|..|.) ~/.gitconfig . - for x in "$@"; do - tar cz * | ssh $x tar xz - done - cd "$startdir" -} - bkrun() { # use -p from interactive shell btrbk-run -p "$@" @@ -956,13 +941,16 @@ rlt() { } rlu() { # [OPTS] HOST PATH - # eg rlu -opts frodo /testpath + # eg. rlu -opts frodo /testpath + # relative paths will expanded with readlink -f. # useful for selectively sending dirs which have been synced with unison, # where the path is the same on both hosts. opts=("${@:1:$#-2}") # 1 to last -2 path="${@:$#}" # last host="${@:$#-1:1}" # last -1 - if [[ $path == .* ]]; then echo error: need absolut path; return 1; fi + if [[ $path == .* ]]; then + path=$(readlink -f $path) + fi # rync here uses checksum instead of time so we don't mess with # unison relying on time as much. g is for group, same reason # to keep up with unison. -- 2.30.2