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

change brew test conditional to not throw errors on non-homebrew systems

This commit is contained in:
William Ting 2012-03-12 09:50:19 -10:00
parent 76f4c7d654
commit 1d2f3be46a

View File

@ -15,8 +15,8 @@
#along with autojump. If not, see <http://www.gnu.org/licenses/>. #along with autojump. If not, see <http://www.gnu.org/licenses/>.
# determine the data directory according to the XDG Base Directory Specification # determine the data directory according to the XDG Base Directory Specification
if [ -n "$XDG_DATA_HOME" ]; then if [ -n "${XDG_DATA_HOME}" ]; then
export AUTOJUMP_DATA_DIR="$XDG_DATA_HOME/autojump" export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump"
else else
export AUTOJUMP_DATA_DIR=~/.local/share/autojump export AUTOJUMP_DATA_DIR=~/.local/share/autojump
fi fi
@ -29,12 +29,12 @@ if [ ! -e "${AUTOJUMP_DATA_DIR}" ]; then
fi fi
# set paths if necessary for local installations # set paths if necessary for local installations
if [[ -d ~/.autojump/ ]]; then if [[ -d "~/.autojump/" ]]; then
path=(~/.autojump/bin $path) path=(~/.autojump/bin $path)
fpath=(~/.autojump/functions/ $fpath) fpath=(~/.autojump/functions/ $fpath)
fi fi
# set fpath if necessary for homebrew installation # set fpath if necessary for homebrew installation
if [[ -n "`which brew`" && -d `brew --prefix`/share/zsh/functions ]]; then if [ -d "`brew --prefix 2>/dev/null`/share/zsh/functions" ]; then
fpath=(`brew --prefix`/share/zsh/functions $fpath) fpath=(`brew --prefix`/share/zsh/functions $fpath)
fi fi
@ -53,4 +53,4 @@ preexec_functions+=autojump_preexec
alias jumpstat="autojump --stat" alias jumpstat="autojump --stat"
function j { local new_path="$(autojump $@)";if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "$new_path";else false; fi } function j { local new_path="$(autojump $@)";if [ -n "${new_path}" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "${new_path}";else false; fi }