Use md5(1) when available (#3855)

md5sum isn't available by default on macOS. Instead, it ships the
BSD-style md5(1) command, which does the same thing but with different
arguments.

With this change, run-tests works out-of-the-box on macOS.
This commit is contained in:
Jon Parise 2021-08-04 16:42:59 -07:00 committed by GitHub
parent 3ba40b4316
commit 9eb39348e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -9,7 +9,11 @@
image=denseanalysis/ale
# Create docker image tag based on Dockerfile contents
image_tag=$(md5sum Dockerfile | cut -d' ' -f1)
if [ -n "$(command -v md5)" ]; then
image_tag=$(md5 -q Dockerfile)
else
image_tag=$(md5sum Dockerfile | cut -d' ' -f1)
fi
git_version=$(git describe --always --tags)
# Used in all test scripts for running the selected Docker image.