From e66c5ecbcaed98f0379953cef7a556fb50659526 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 18 May 2017 11:32:02 +0200 Subject: only jump to diary_location if its defined --- diary | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/diary b/diary index 724bca5..0eb9455 100755 --- a/diary +++ b/diary @@ -140,7 +140,7 @@ else fi -pushd $diary_location > /dev/null +[ -n "$diary_location" ] && pushd $diary_location > /dev/null # set defaults if [ ! "$EDITOR" ] @@ -159,5 +159,7 @@ help) shift; cmd_help "$@" ;; *) cmd_edit_or_usage "$@" ;; esac -popd > /dev/null +[ -n "$diary_location" ] && popd > /dev/null + +exit 0 -- cgit v1.2.3