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

If autojump can't find the directory, attempt a cd

This commit is contained in:
David Frascone 2015-06-09 14:42:44 -06:00
parent f09d23e30d
commit 55f4eacc8a

View File

@ -49,15 +49,20 @@ function j
autojump $argv
case '*'
set -l output (autojump $argv)
if test -d "$output"
set_color red
echo $output
set_color normal
cd $output
# Check for . and attempt a regular cd
if [ $output = "." ]
cd $argv
else
__aj_err "autojump: directory '"$argv"' not found"
__aj_err "\n$output\n"
__aj_err "Try `autojump --help` for more information."
if test -d "$output"
set_color red
echo $output
set_color normal
cd $output
else
__aj_err "autojump: directory '"$argv"' not found"
__aj_err "\n$output\n"
__aj_err "Try `autojump --help` for more information."
end
end
end
end