Skip to content

Commit 68b2c76

Browse files
koobsghuntley
authored andcommitted
Allow specifying make command via environment
1 parent 2b54026 commit 68b2c76

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/lib.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ realpath() {
3333
SCRIPT_DIR="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
3434
PROJECT_ROOT="$(cd "$SCRIPT_DIR" && realpath "$(git rev-parse --show-toplevel)")"
3535

36+
# Allow specifying/overriding make command via environment
37+
MAKECMD?=make
38+
3639
# Allow specifying/overriding GETOPT via environment
3740
GETOPT?=getopt
3841

@@ -173,7 +176,7 @@ if [[ "${CODER_LIBSH_NO_CHECK_DEPENDENCIES:-}" != *t* ]]; then
173176
# We have to disable pipefail temporarily to avoid ERRPIPE errors when
174177
# piping into `head -n1`.
175178
set +o pipefail
176-
make_version="$(make --version 2>/dev/null | head -n1 | grep -oE '([[:digit:]]+\.){1,2}[[:digit:]]+')"
179+
make_version="$($(MAKECMD) --version 2>/dev/null | head -n1 | grep -oE '([[:digit:]]+\.){1,2}[[:digit:]]+')"
177180
set -o pipefail
178181
if [[ ${make_version//.*/} -lt 4 ]]; then
179182
libsh_bad_dependencies=1

0 commit comments

Comments
 (0)