From 9ad75a54c713b487f1ed5c13b99cfa3ce8d3f35c Mon Sep 17 00:00:00 2001 From: Leonid Shevtsov Date: Tue, 18 Nov 2014 10:55:01 +0200 Subject: [PATCH] =?UTF-8?q?Port=20=E2=80=9CTest=20/=20create=20errors=20di?= =?UTF-8?q?rectory=20before=20writing=20to=20it.=20(573c1ea418aaf40d8c25dc?= =?UTF-8?q?8f799435e1f9f97bd5)=E2=80=9D=20to=20fish=20shell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/autojump.fish | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/autojump.fish b/bin/autojump.fish index e4b6026..0a2815f 100644 --- a/bin/autojump.fish +++ b/bin/autojump.fish @@ -19,11 +19,18 @@ else set -x AUTOJUMP_ERROR_PATH ~/.local/share/autojump/errors.log end +if test ! -d "(dirname $AUTOJUMP_ERROR_PATH)" + mkdir -p "(dirname $AUTOJUMP_ERROR_PATH)" +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