Skip to content

Commit 34809e2

Browse files
committed
Fix MacOS missing the sha256sum command in CI
1 parent 6292c99 commit 34809e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/check_remote_java_tools_configs.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ function download_and_check_hash() {
2222
TMP_FILE=$(mktemp -q /tmp/remotejavatools.XXXXXX)
2323
echo "fetching $name from $url to ${TMP_FILE}"
2424
curl --silent -o ${TMP_FILE} -L "$url"
25-
actual_hash=`sha256sum ${TMP_FILE} | cut -d' ' -f1`
25+
if command -v sha256sum &> /dev/null; then
26+
actual_hash=`sha256sum ${TMP_FILE} | cut -d' ' -f1`
27+
else
28+
actual_hash=`shasum -a 256 ${TMP_FILE} | cut -d' ' -f1`
29+
fi
2630
if [ "${hash}" != "${actual_hash}" ]; then
2731
echo "ERROR: wrong hash for ${name}! wanted: ${hash}, got: ${actual_hash}"
2832
exit 1

0 commit comments

Comments
 (0)