From a5b88497d10a5d85bf47511ca77cc786778b446b Mon Sep 17 00:00:00 2001 From: Lazarus Lazaridis Date: Mon, 12 Mar 2018 09:32:07 +0200 Subject: [PATCH] Fix shellcheck errors and warnings. --- goto.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/goto.sh b/goto.sh index 2ca533b..c621ca9 100644 --- a/goto.sh +++ b/goto.sh @@ -221,22 +221,22 @@ _goto_unregister_alias() } # Pushes the current directory onto the stack, then goto -function _goto_directory_push() +_goto_directory_push() { if [ "$#" -ne "1" ]; then _goto_error "usage: goto -p|--push " return fi - pushd . 2>&1 1>/dev/null + { pushd . || return; } 1>/dev/null 2>&1 - _goto_directory $@ + _goto_directory "$@" } # Pops the top directory from the stack, then goto -function _goto_directory_pop() +_goto_directory_pop() { - popd 2>&1 1>/dev/null + { popd || return; } 1>/dev/null 2>&1 } # Unregisters aliases whose directories no longer exist.