X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.bash_profile;h=3d5d0754713da7478d7818e39b7173e9de1ddc75;hp=6fe0759a4575e80ef646ccf8a3a6cca7a9082ba0;hb=84e1a34d8cc3838b7666ba26f02648cdee4906c6;hpb=a8e823fa2005ab190af0461c967f353b7dbb5a51;ds=inline diff --git a/.bash_profile b/.bash_profile index 6fe0759..3d5d075 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,4 +1,13 @@ if [ -t 0 -o "${0:0:1}" = "-" -o "$1" = "force" ]; then + # Set up PROFILE_HOME if called outside HOME. + if [ -z "$PROFILE_HOME" ]; then + # BASH_SOURCE isn't available prior to bash 3. + profile_home=${BASH_SOURCE%/*} + [ "$profile_home" = "$BASH_SOURCE" ] && profile_home=$PWD + [ "$profile_home" = "$HOME" ] || PROFILE_HOME=$profile_home + unset profile_home + fi + # Remember if nocaseglob was on. shopt -q nocaseglob nocg=$?