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

View File

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