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

pull/366/head
David Frascone 9 years ago
parent f09d23e30d
commit 55f4eacc8a

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

Loading…
Cancel
Save