File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,13 @@ if [ $? -ne 0 ]; then
7979 DIFF=diff
8080fi
8181
82- SHA1SUM=$( which sha1sum)
83- if [ $? -ne 0 ]; then
84- SHA1SUM=shasum
82+ if command -v sha1sum > /dev/null 2>&1 ; then
83+ SHA1SUM=" sha1sum"
84+ elif command -v shasum > /dev/null 2>&1 ; then
85+ SHA1SUM=" shasum"
86+ else
87+ echo " [!] sha1sum or shasum not installed." >&2
88+ exit 1
8589fi
8690
8791FILES=$( git diff --cached --name-only --diff-filter=ACMR | grep -E " \.(c|cpp|h)$" )
@@ -116,7 +120,7 @@ if [ ! -z "${FILES[*]}" ]; then
116120 echo " ${FILES[*]} "
117121fi
118122
119- $SHA1SUM -c scripts/checksums > /dev/null
123+ $SHA1SUM -c scripts/checksums 2> /dev/null > /dev/null
120124if [ $? -ne 0 ]; then
121125 echo " [!] You are not allowed to change the header file queue.h or list.h" >&2
122126 exit 1
You can’t perform that action at this time.
0 commit comments