Fix shellcheck errors and warnings.

This commit is contained in:
Lazarus Lazaridis 2018-03-12 09:32:07 +02:00
parent 2db8b0bf1f
commit a5b88497d1

10
goto.sh
View File

@ -221,22 +221,22 @@ _goto_unregister_alias()
} }
# Pushes the current directory onto the stack, then goto # Pushes the current directory onto the stack, then goto
function _goto_directory_push() _goto_directory_push()
{ {
if [ "$#" -ne "1" ]; then if [ "$#" -ne "1" ]; then
_goto_error "usage: goto -p|--push <alias>" _goto_error "usage: goto -p|--push <alias>"
return return
fi 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 # 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. # Unregisters aliases whose directories no longer exist.