diff --git a/bake b/bake index b4974aa..4bbe9c2 100755 --- a/bake +++ b/bake @@ -1,5 +1,5 @@ #!/bin/bash -## VERSION 22.4.2 +## VERSION 22.4.3 ## 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, @@ -101,10 +101,14 @@ _source_bakefile() { fi . "$BAKEFILE" fi; } - +_update_self() { + curl -S -f -o "$0" -z "$0" \ + "https://raw.githubusercontent.com/moonq/bake/main/bake" +} for (( i=1; i<=$#; i++ )); do if [[ $i -eq 1 ]]; then if [[ "${!i}" = "__list__" ]]; then _flines | sed 's/().*//'; exit; fi + if [[ "${!i}" = "__update__" ]]; then _update_self; exit; fi fi j=$(( i + 1 )) if [[ "${!i}" = "-m" ]]; then _smenu; exit; fi