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

#114: Error message when directory does not exist or not in autojump database.

This commit is contained in:
William Ting 2012-04-02 21:58:43 +09:00
parent 465ca7908a
commit c91843c698
2 changed files with 25 additions and 2 deletions

View File

@ -80,4 +80,16 @@ case $PROMPT_COMMAND in
esac esac
alias jumpstat="autojump --stat" alias jumpstat="autojump --stat"
function j { new_path="$(autojump $@)";if [ -d "${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
echo "autojump: directory '${@}' not found"
echo "Try \`autojump --help\` for more information."
false
fi
}

View File

@ -52,4 +52,15 @@ preexec_functions+=autojump_preexec
alias jumpstat="autojump --stat" alias jumpstat="autojump --stat"
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 } function j {
local new_path="$(autojump $@)"
if [ -d "${new_path}" ]; then
echo -e "\\033[31m${new_path}\\033[0m"
cd "${new_path}"
else
echo "autojump: directory '${@}' not found"
echo "Try \`autojump --help\` for more information."
false
fi
}