Fix the dotfiles directory sourcing

This commit is contained in:
Alexander Hosking 2017-03-29 16:50:27 -04:00
parent 71fe80ffd0
commit b8a86f98ce

View File

@ -8,11 +8,12 @@ esac
READLINK=$(which greadlink || which readlink)
CURRENT_SCRIPT=$BASH_SOURCE
if [[ -n $CURRENT_SCRIPT && -x "$READLINK" ]]; then
if [ -d "$HOME/.dotfiles" ]; then
DOTFILES_DIR="$HOME/.dotfiles"
elif [[ -n $CURRENT_SCRIPT && -x "$READLINK" ]]; then
SCRIPT_PATH=$($READLINK -f "$CURRENT_SCRIPT")
DOTFILES_DIR=$(dirname "$(dirname "$SCRIPT_PATH")")
elif [ -d "$HOME/.dotfiles" ]; then
DOTFILES_DIR="$HOME/.dotfiles"
echo $DOTFILES_DIR
else
echo "Unable to find dotfiles, exiting."
return # `exit 1` would quit the shell itself
@ -25,8 +26,7 @@ for DOTFILE in "$DOTFILES_DIR"/system/.{function,env,alias,prompt}; do
done
# Set LSCOLORS
eval "$(dircolors "$DOTFILES_DIR"/system/.dir_colors)"
eval "$(dircolors $DOTFILES_DIR/system/.dir_colors)"
# Hook for extra/custom stuff