From c3b678aa93a43c25cf5d4d5a0c9544f5eecfcc29 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 4 Feb 2015 10:23:24 +0000 Subject: [PATCH] Fixed regression in previous commit. The check for canonoicalising the profile path inadvertently stopped it working when sourced from the current directory. --- .bash_profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bash_profile b/.bash_profile index 6648c33..9d6fa56 100644 --- a/.bash_profile +++ b/.bash_profile @@ -3,7 +3,7 @@ if [ -t 0 -o "${0:0:1}" = "-" -o "$1" = "force" ]; then if [ -z "$PROFILE_HOME" ]; then # BASH_SOURCE isn't available prior to bash 3. profile_home=${BASH_SOURCE%/*} - [ -n "$profile_home" -a ! "${profile_home:0:1}" = "/" ] && profile_home=$(readlink -f "$profile_home" 2>/dev/null) + [ -n "$profile_home" -a -d "$profile_home" -a ! "${profile_home:0:1}" = "/" ] && profile_home=$(readlink -f "$profile_home" 2>/dev/null) [ "$profile_home" = "$BASH_SOURCE" ] && profile_home=$PWD [ "$profile_home" = "$HOME" ] || PROFILE_HOME=$profile_home unset profile_home -- 2.20.1