From 630361abb687dc89fb3caf5f50a6590f9f76f11a Mon Sep 17 00:00:00 2001 From: xonix Date: Fri, 6 Aug 2021 21:11:26 +0300 Subject: [PATCH] Is it possible to make ./makesure --selfupdate to work on Win? #22 --- makesure.awk | 2 +- tests/12_update.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/makesure.awk b/makesure.awk index 033acf7..b0bf710 100755 --- a/makesure.awk +++ b/makesure.awk @@ -554,7 +554,7 @@ function addL(s, l) { return s ? s "\n" l : l } function arrPush(arr, elt) { arr[arr[-7]++] = elt } function arrLen(arr) { return 0 + arr[-7] } function arrLast(arr) { return arr[arrLen(arr)-1] } -function commandExists(cmd) { return ok("command -v " cmd " >/dev/null 2>&1") } +function commandExists(cmd) { return ok("command -v " cmd " >/dev/null") } function ok(cmd) { return system(cmd) == 0 } function isFile(path) { return ok("test -f " quoteArg(path)) } function isDir(path) { return ok("test -d " quoteArg(path)) } diff --git a/tests/12_update.sh b/tests/12_update.sh index b5762d6..9e99767 100644 --- a/tests/12_update.sh +++ b/tests/12_update.sh @@ -42,19 +42,15 @@ @depends_on run_selfupdate @goal wget_prepared -# set -x cmd="wget" -# echo "$cmd1 :: $?" ( echo "#!/bin/bash" echo 'echo "running wget"' - if cmd1=`command -v $cmd 2>/dev/null` + if cmd1=`command -v $cmd` then echo "exec $cmd1 \"\$@\"" else # fake wget with curl -# echo "set -x" -# echo 'echo "1=$1 2=$2 3=$3"' echo "exec $(command -v curl) \"\${1/-q/-s}\" \"\$2\" \"\${3/-O/-o}\"" fi ) > "$D/$cmd"