From b38e9171d84dcf0ae6a4bcc576ac1ae5e1d49c3c Mon Sep 17 00:00:00 2001 From: xonixx Date: Mon, 9 Dec 2024 02:26:55 +0200 Subject: [PATCH] selfupdate is broken #174 --- makesure.awk | 2 +- tests/200_update.tush | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/makesure.awk b/makesure.awk index 3bd1697..1ee24fc 100755 --- a/makesure.awk +++ b/makesure.awk @@ -729,10 +729,10 @@ function selfUpdate( tmp, err, newVer,line,sha) { if (line ~ /"sha":/) { if (match(line = substr(line, index(line, "\"sha\":") + 6), /"[a-z0-9]+"/)) sha = substr(line, RSTART + 1, RLENGTH - 2) - if (!sha) err = "unable to get the latest commit" break } } + if (!sha) err = "unable to get the latest commit" if (!err) { # now download the latest executable err = dl("https://raw.githubusercontent.com/xonixx/makesure/" sha "/makesure", tmp) diff --git a/tests/200_update.tush b/tests/200_update.tush index 8f01013..15d0fe7 100644 --- a/tests/200_update.tush +++ b/tests/200_update.tush @@ -13,8 +13,10 @@ $ ./$MAKESURE -f tests/200_update.sh test_wget | awk '{ sub(/[0-9][0-9.]+/,"YYY" | goal 'test_wget' ... | XXX | running wget +| running wget | updated XXX -> YYY | running wget +| running wget | you have latest version YYY installed | YYY @@ -24,7 +26,9 @@ $ ./$MAKESURE -f tests/200_update.sh test_curl | awk '{ sub(/[0-9][0-9.]+/,"YYY" | goal 'test_curl' ... | XXX | running curl +| running curl | updated XXX -> YYY | running curl +| running curl | you have latest version YYY installed | YYY