X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=.bashrc;h=c27af43a08e607c9c6f863c551c552608add152d;hb=a5d4a2af585b0eed9c613f3e1557b6c9c760d3de;hp=6780da6b0717979d282be522c1cba33a44d02eca;hpb=6f1f8a104c9b38936ade2d27e835479523985133;p=distro-setup diff --git a/.bashrc b/.bashrc index 6780da6..c27af43 100644 --- a/.bashrc +++ b/.bashrc @@ -55,17 +55,26 @@ else # this file, and we don't want to do that and cause an infinite # loop. fi - _x=$(readlink -f ${BASH_SOURCE[0]}) - _x=${_x%/*}/brc - if [[ -r $_x ]]; then + _tmp=$(readlink -f ${BASH_SOURCE[0]}) + _tmp=${_tmp%/*} + _tmp2=$_tmp/brc + if [[ -s $_tmp2 ]]; then # shellcheck source=./brc - source $_x + source $_tmp2 fi # brc2 is for things i dont necessarily want on every system - _x=${_x%/*}/brc2 - if [[ -r $_x ]]; then + _tmp2=$_tmp/brc2 + if [[ -s $_tmp2 ]]; then # shellcheck source=./brc2 - source $_x + source $_tmp2 + else + # This check is for when running the sl() command, + # and the remote host got its type misidentified. + _tmp2=$_tmp/../brc2 + if [[ -s $_tmp2 ]]; then + # shellcheck source=./brc2 + source $_tmp2 + fi fi fi # ensure no bad programs appending to this file will have an affect