From 465ca7908a7cf46a066855c01dd888d5ed397953 Mon Sep 17 00:00:00 2001 From: William Ting Date: Mon, 2 Apr 2012 11:33:10 +0900 Subject: [PATCH] Fixes #114: autojump suppresses the error message caused by 'j --help'. --- autojump.bash | 3 +-- autojump.zsh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/autojump.bash b/autojump.bash index 0de49dd..76145a1 100644 --- a/autojump.bash +++ b/autojump.bash @@ -80,5 +80,4 @@ case $PROMPT_COMMAND in esac alias jumpstat="autojump --stat" -function j { new_path="$(autojump $@)";if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "$new_path";else false; fi } - +function j { new_path="$(autojump $@)";if [ -d "${new_path}" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "${new_path}";else false; fi } diff --git a/autojump.zsh b/autojump.zsh index 877863e..77fa649 100644 --- a/autojump.zsh +++ b/autojump.zsh @@ -52,4 +52,4 @@ preexec_functions+=autojump_preexec 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 [ -d "${new_path}" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "${new_path}";else false; fi }