From 9eb39348e928e6a89938784e67ba4168c5a295c0 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Wed, 4 Aug 2021 16:42:59 -0700 Subject: [PATCH] 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. --- run-tests | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run-tests b/run-tests index 6c2153fa..d0ca0ac6 100755 --- a/run-tests +++ b/run-tests @@ -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.