:: commit 3e056121eb5f8b9dd802be02899325994e7d3ac3

q66 <q66@chimera-linux.org> — 2025-03-03 22:16

parents: 7f50386fb1

bootstrap: fix posix compliance

The "command" builtin takes an executable name, not a full
command line with arguments, which on some shells will result
in nothing being matched.
diff --git a/bootstrap b/bootstrap
index c1e08f61..3ff7b827 100755
--- a/bootstrap
+++ b/bootstrap
@@ -37,9 +37,9 @@ clone_repo_commit() {
 
 download_by_hash() {
     DOWNLOAD_COMMAND="curl -Lo"
-    if ! command -v $DOWNLOAD_COMMAND >/dev/null 2>&1; then
+    if ! command -v "${DOWNLOAD_COMMAND% *}" >/dev/null 2>&1; then
         DOWNLOAD_COMMAND="wget -O"
-        if ! command -v $DOWNLOAD_COMMAND >/dev/null 2>&1; then
+        if ! command -v "${DOWNLOAD_COMMAND% *}" >/dev/null 2>&1; then
             set +x
             echo "error: Neither curl nor wget found"
             exit 1
tab: 248 wrap: offon