From 6bdd568b38b70f3a91709336a81726d5837fab86 Mon Sep 17 00:00:00 2001 From: kevin zhuang Date: Mon, 22 Jun 2020 08:10:08 +1000 Subject: [PATCH] refactor(main): remove some shellcheck disable --- dotbare | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dotbare b/dotbare index d928524..4921e3a 100755 --- a/dotbare +++ b/dotbare @@ -5,7 +5,6 @@ # @params # Globals # ${mydir}: string, directory of the executing script, used for sourcing helpers -# ${action_command}: string, determine which script to call # Arguments # action_command: sub commands dotbare should run # General git command: log, status etc @@ -43,7 +42,7 @@ function usage() { } # if no argument, display all possible actions -if [[ $# -eq 0 ]]; then +if [[ "$#" -eq 0 ]]; then find "${mydir}"/scripts/* -type f -print0 \ | xargs -I __ -0 basename __ \ | fzf --no-multi --header='Available commands' --preview="dotbare {} -h" \ @@ -51,8 +50,7 @@ if [[ $# -eq 0 ]]; then exit 0 fi -# shellcheck disable=SC2199 -[[ "$@" == 'add --all' ]] && \ +[[ "$*" == 'add --all' ]] && \ echo 'If you intend to stage all modified file, run dotbare add -u' && \ echo "dotbare disabled add --all option as this will stage every single file in ${DOTBARE_TREE}" && \ exit 1 @@ -64,7 +62,6 @@ case "$1" in ;; *) if [[ -x "${mydir}/scripts/$1" ]]; then - # run the scripts exec "${mydir}/scripts/$1" "${@:2}" fi ;;