From 9bcd6bc22cc1ebae5b7603cbe38e2d51dd95c194 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 7 May 2014 18:35:02 -0700 Subject: [PATCH] Remove path.sh, move contents to shellrc.sh --- dotfiles/lib/shellrc.sh | 24 ++++++++++++++---------- dotfiles/lib/shellrc/path.sh | 11 ----------- 2 files changed, 14 insertions(+), 21 deletions(-) delete mode 100644 dotfiles/lib/shellrc/path.sh diff --git a/dotfiles/lib/shellrc.sh b/dotfiles/lib/shellrc.sh index 2ebbec2b..72dc7da3 100644 --- a/dotfiles/lib/shellrc.sh +++ b/dotfiles/lib/shellrc.sh @@ -1,11 +1,15 @@ -for filename in ~/.lib/shellrc/*; do - source $filename -done -# Source everything twice just in case there were things that depended -# on each other. -for filename in ~/.lib/shellrc/*; do - source $filename -done +function add_to_front_of_path { + export PATH=$@:$(echo $PATH | sed "s|:*$@||g" | sed "s|^:||") +} -local dircolors_file="$HOME/.dircolors" -test -r $dircolors_files && eval "$(dircolors $dircolors_file)" +function add_to_back_of_path { + export PATH=$(echo $PATH | sed "s|:*$@||g" | sed "s|^:||"):$@ +} + +add_to_back_of_path "$HOME/.local/lib/python2.6/site-packages" +hash brew 2>/dev/null && add_to_front_of_path "$(brew --prefix coreutils)/libexec/gnubin" +add_to_front_of_path "/usr/local/bin" + +for filename in ~/.lib/shellrc/*; do + source $filename +done diff --git a/dotfiles/lib/shellrc/path.sh b/dotfiles/lib/shellrc/path.sh deleted file mode 100644 index 1aefd485..00000000 --- a/dotfiles/lib/shellrc/path.sh +++ /dev/null @@ -1,11 +0,0 @@ -function add_to_front_of_path { - export PATH=$@:`echo $PATH | sed "s|:*$@||g" | sed "s|^:||"` -} - -function add_to_back_of_path { - export PATH=`echo $PATH | sed "s|:*$@||g" | sed "s|^:||"`:$@ -} - -add_to_back_of_path "$HOME/.local/lib/python2.6/site-packages" -add_to_front_of_path "$(brew --prefix coreutils)/libexec/gnubin" -add_to_front_of_path "/usr/local/bin"