From cc99e1a3f38ce41a9faa6ca4b55cfd96ba246116 Mon Sep 17 00:00:00 2001 From: HacKan Date: Sun, 9 Feb 2020 19:02:00 -0300 Subject: [PATCH] Replace `which` with `command` --- src/b2rsum.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/b2rsum.bash b/src/b2rsum.bash index 4f77416..a092a34 100755 --- a/src/b2rsum.bash +++ b/src/b2rsum.bash @@ -113,7 +113,7 @@ check_dependencies() { DEPENDENCIES=( "b2sum" "getopt" ) result=0 for dep in "${DEPENDENCIES[@]}"; do - which "$dep" > /dev/null 2>&1 + command -v "$dep" > /dev/null 2>&1 result=$((result | $?)) done return $result @@ -283,6 +283,7 @@ check_dependencies || die "Dependencies not met, can't continue" # Arguments OPTS="$(getopt -o hbctwsql:o:: -l help,version,license,binary,check,length:,text,tag,ignore-missing,quiet,status,strict,warn,output:: -n "$PROGRAM" -- "$@")" +# shellcheck disable=SC2181 [[ $? -ne 0 ]] && die "Wrong option. Try '$PROGRAM --help' for more information." eval set -- "$OPTS"