tools: Fix selection of container engine
authorKim Alvefur <zash@zash.se>
Tue, 12 Dec 2023 16:19:04 +0100
changeset 13407 0369f6986824
parent 13406 6877786d73d7
child 13408 034c7af177f0
tools: Fix selection of container engine Seems command -v in sh only checks and returns one argument, unlike bash.
tools/build-env/build.sh
--- a/tools/build-env/build.sh	Tue Dec 12 13:41:14 2023 +0000
+++ b/tools/build-env/build.sh	Tue Dec 12 16:19:04 2023 +0100
@@ -2,7 +2,12 @@
 
 cd "$(dirname "$0")"
 
-containerify="$(command -v podman docker)"
+containerify="$(command -v podman || command -v docker)"
+
+if [ -z "$containerify" ]; then
+	echo "podman or docker required" >&2
+	exit 1
+fi
 
 $containerify build -f ./Containerfile --squash \
 	--build-arg os="${2:-debian}" \