diff --git a/bin/autojump.fish b/bin/autojump.fish index e995506..2e8c845 100644 --- a/bin/autojump.fish +++ b/bin/autojump.fish @@ -32,7 +32,11 @@ end # change pwd hook function __aj_add --on-variable PWD status --is-command-substitution; and return - autojump --add (pwd) >/dev/null 2>>$AUTOJUMP_ERROR_PATH & + if test -f "$AUTOJUMP_ERROR_PATH" + autojump --add (pwd) >/dev/null 2>>"$AUTOJUMP_ERROR_PATH" & + else + autojump --add (pwd) >/dev/null & + end end