Skip to content

Commit

Permalink
selfupdate is broken #174
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Dec 9, 2024
1 parent 8c645e3 commit b38e917
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions tests/200_update.tush
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit b38e917

Please sign in to comment.