Skip to content

Commit

Permalink
Replace binary "which" with build in "command"
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesplain committed Jan 3, 2020
1 parent 35039d2 commit 202b9cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/sha1
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ set -o pipefail
in=$1
out=$2

if ( which sha1sum > /dev/null ); then
if ( command -v sha1sum > /dev/null ); then
(sha1sum $in | cut -d' ' -f1) > $out
elif ( which shasum > /dev/null ); then
elif ( command -v shasum > /dev/null ); then
(shasum -a 1 $in | cut -d' ' -f1) > $out
else
echo "Neither sha1sum nor shasum command is available"
Expand Down
4 changes: 2 additions & 2 deletions tools/sha256
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ set -o pipefail
in=$1
out=$2

if ( which sha256sum > /dev/null ); then
if ( command -v sha256sum > /dev/null ); then
(sha256sum $in | cut -d' ' -f1) > $out
elif ( which shasum > /dev/null ); then
elif ( command -v shasum > /dev/null ); then
(shasum -a 256 $in | cut -d' ' -f1) > $out
else
echo "Neither sha256sum nor shasum command is available"
Expand Down

0 comments on commit 202b9cf

Please sign in to comment.