Skip to content

Commit

Permalink
notify when new script version is available
Browse files Browse the repository at this point in the history
add a version check for the updater itself to fix #15

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
  • Loading branch information
LucasLarson committed May 21, 2023
1 parent 66a8ca8 commit 488bd7e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion update
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
update='2023-05-22'
update='2023-05-23'
IFS="$(command printf -- ' \t\n|')"
IFS="${IFS%'|'}"
command printf -- '\n\n .___ __\n __ ________ __\174 _\057____ _\057 \174_ ____\n\174 \174 \134____ \134 \057 __ \174\134__ \134\134 __\134\057 __ \134\n\174 \174 \057 \174_\076 \076 \057_\057 \174 \057 __ \134\174 \174 \134 ___\057\n\174____\057\174 __\057\134____ \174\050____ \057__\174 \134___ \076\n \174__\174 \134\057 \134\057 \134\057\n a Lucas Larson production\n\n' >&2 && command sleep -- 1
Expand All @@ -18,6 +18,13 @@ command printf -- '\n\n' >&2
command printf -- 'No internet connection detected.\nAborting update.\n' >&2
return "${update:-1}"
}
set -- 'https://github.com/LucasLarson/update/raw/HEAD/update'
command test "$({ command wget --output-document=- --quiet -- "${1-}" || command curl --location --silent -- "${1-}"; } 2>/dev/null | command sed -n -e '$s/[^[:digit:]]//gp')" -le "$(command printf -- '%s\n' "${update-}" | command sed -e 's/[^[:digit:]]//g')" || {
command printf -- 'An update to this updater is available\041 Download it from here:\n%s\n' "${1-}" >&2
update=''
unset -v -- update 2>/dev/null
exit
}
command printf -- '\360\237\215\272 checking for Homebrew installation...' >&2
if command -v -- brew >/dev/null 2>&1; then
command printf -- ' \342\234\205 found\n' >&2
Expand Down

0 comments on commit 488bd7e

Please sign in to comment.