diff --git a/auto-update b/auto-update index d7e0a5b..17fe505 100755 --- a/auto-update +++ b/auto-update @@ -1,17 +1,17 @@ #!/usr/bin/env sh note() { printf >&2 '\033[1m%s\033[0m\n' "$*" ;} + latest() { : \ - && url="${1?huh}" \ + && url="${1?missing argument}" \ && { [ "${url#"https://github.com/"}" = "$url" ] \ && re='/commit/' || re='/spoofed_commit_check/' \ ;} \ && curl $flags "$url" | grep -F "$re" | grep -Eo '[0-9a-f]{40}' \ ;} -: \ - && any=0 flags="-L --no-progress-meter" n="$(printf '\n.')" n="${n%.}" \ - && df=Dockerfile gh='https://github.com/' sr='https://git.sr.ht/~' \ +any=0 flags="-L --no-progress-meter" n="$(printf '\n.')" n="${n%.}" \ +df=Dockerfile gh='https://github.com/' sr='https://git.sr.ht/~' \ && set -- \ cosmo COSMO_COMMIT ${gh}jart/cosmopolitan \ cosmo-kuroko KUROKO_COMMIT ${gh}kuroko-lang/kuroko \