From 969e664e635182d9dbdef9f385fff62e97ef7485 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 6 Feb 2012 13:57:00 +0000 Subject: [PATCH] slightly better shell initialization with a semi-sane fallback --- shellrc.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shellrc.sh b/shellrc.sh index 1fcb595..78b17be 100644 --- a/shellrc.sh +++ b/shellrc.sh @@ -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