slightly better shell initialization with a semi-sane fallback

This commit is contained in:
2012-02-06 13:57:00 +00:00
parent 82e88d07a6
commit 969e664e63

View File

@@ -3,10 +3,12 @@
#
# Set path to root of dotfiles
if [ -n "${BASH_SOURCE[0]}" ]; then
if [ -n "${BASH_SOURCE[0]}" ] && [ -f "${BASH_SOURCE[0]}" ] ; then
DOTFILES="`dirname \"${BASH_SOURCE[0]}\"`"
elif [ -n "$0" ]; then
elif [ -n "$0" ] && [ -f "$0" ]; then
DOTFILES="`dirname \"$0\"`"
elif [ -d "$HOME/.dotfiles" ]; then
DOTFILES="$HOME/.dotfiles"
fi
# Load main dotfiles