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
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

Loading…
Cancel
Save