From d7efd6906bb397fa4e468db408f5d664b7ec8848 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Thu, 2 Jun 2022 13:17:37 +0300 Subject: [PATCH] more verbose update --- bake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bake b/bake index c8857fb..8bc880b 100755 --- a/bake +++ b/bake @@ -1,5 +1,5 @@ #!/bin/bash -## VERSION 22.6.1 +## VERSION 22.6.2 ## BASH-MAKE ========================================================== ## Utility to mimick some of GNU Make behavior, but run in a single ## bash shell. This executable can be used as the Bakefile, too, @@ -114,9 +114,15 @@ _source_bakefile() { . "$BAKEFILE" fi; } _update_self() { + printf "Update %s => %s\n" \ + "$( grep "^## VERSION" "$0" | awk '{ print $3 }' )" \ + "$( curl -s -S -f \ + "https://raw.githubusercontent.com/moonq/bake/main/bake" | \ + grep "^## VERSION" | awk '{ print $3 }' )" >&2 || true curl -S -f -o "$0" -z "$0" \ "https://raw.githubusercontent.com/moonq/bake/main/bake" chmod +x "$0" + echo Updated. >&2 } @() { echo +"$@" >&2; "$@"; } # Print command before running it