diff --git a/bin/autojump.fish b/bin/autojump.fish index 19cb27e..ead7ea1 100644 --- a/bin/autojump.fish +++ b/bin/autojump.fish @@ -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