1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

Fixing paths

This commit is contained in:
Mitchell Ludwig 2019-11-30 12:12:01 -07:00
parent e42645df00
commit 7d166448c9
2 changed files with 10 additions and 7 deletions

View File

@ -1,8 +1,10 @@
# the login $SHELL isn't always the one used
# NOTE: problems might occur if /bin/sh is symlinked to /bin/bash
if [ -n "${BASH}" ]; then
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
shell="bash"
elif [ -n "${ZSH_NAME}" ]; then
SCRIPT_DIR="${0:a:h}"
shell="zsh"
elif [ -n "${__fish_datadir}" ]; then
shell="fish"
@ -24,10 +26,9 @@ elif [ -s ~/.autojump/share/autojump/autojump.${shell} ]; then
elif [ -s /usr/local/share/autojump/autojump.${shell} ]; then
source /usr/local/share/autojump/autojump.${shell}
else
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -s "$SCRIPT_DIR/autojump.${shell}" ]; then
source "$SCRIPT_DIR/autojump.${shell}"
else
echo "ERROR: autojump not found"
fi
if [ -s "$SCRIPT_DIR/autojump.${shell}" ]; then
source "$SCRIPT_DIR/autojump.${shell}"
else
echo "ERROR: autojump not found"
fi
fi

View File

@ -1,6 +1,8 @@
export AUTOJUMP_SOURCED=1
SCRIPT_DIR="${0:a:h}"
# set user installation paths
path=(${SCRIPT_DIR} ${path})
if [[ -d ~/.autojump/bin ]]; then
path=(~/.autojump/bin ${path})
fi
@ -17,7 +19,7 @@ if command -v brew &>/dev/null; then
fi
fi
# set this installation path
# set error file location
if [[ "$(uname)" == "Darwin" ]]; then
export AUTOJUMP_ERROR_PATH=~/Library/autojump/errors.log