Skip to content

Commit

Permalink
notify when new script version is available (#29)
Browse files Browse the repository at this point in the history
- notify when new script version is available
- repair search for date
- print first variable assignment instead of end-of-file date (66a8ca8)
- repair `sleep` calls
- add end-of-options delimiter to `read` (#30)
- upgrade, repair changelog generator (#31)
- match GNU `sed` debug formatting
- check connection with more widely accessible host
- check for update using globally-accessible URL
- generate brew bundle with VSCode extensions
- truncate `$IFS` only if modified

Signed-off-by: Lucas Larson <[email protected]>
Co-authored-by: GitHub <[email protected]>
  • Loading branch information
LucasLarson and actions-user authored Jul 11, 2023
1 parent 29f1dbf commit df8d226
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions update
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env sh
update='2023-06-25'
IFS="$(command printf -- ' \t\n|')"
IFS="${IFS%'|'}"
update='2023-07-15'
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
command printf -- '\360\237\223\241 verifying network connectivity' >&2
command sleep 1
Expand All @@ -13,11 +12,18 @@ done
i=''
unset -v -- i 2>/dev/null
command printf -- '\n\n' >&2
{ command ping -c 1 -- one.one.one.one >/dev/null 2>&1 && command ping -c 1 -- 8.8.8.8 >/dev/null 2>&1; } || {
{ command ping -c 1 -- one.one.one.one >/dev/null 2>&1 && command ping -c 1 -- 9.9.9.9 >/dev/null 2>&1; } || {
update="${?-}"
command printf -- 'No internet connection detected.\nAborting update.\n' >&2
return "${update:-1}"
}
set -- 'https://lucaslarson.net/update'
command test "$({ command wget --output-document=- --quiet -- "${1-}" || command curl --location --silent -- "${1-}"; } 2>/dev/null | command sed -n -e '/update=/ {' -e 's/[^[:digit:]]//gp' -e 'q' -e '}')" -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 Expand Up @@ -114,7 +120,7 @@ if command -v -- python3 >/dev/null 2>&1; then
fi
if command -v -- brew >/dev/null 2>&1; then
command brew generate-man-completions --debug --verbose 2>/dev/null
command brew bundle dump --all --cask --debug --describe --file=- --force --formula --mas --no-restart --tap --verbose --whalebrew | command sed -e '$!N' -e '/^#.*\n[^#]/s/\n/\t/' -e 'P' -e 'D' | command awk -F '\t' -- '{print $2 $1}' | command sed -e 's/^\(tap\)/1\1/' -e 's/^\(brew\)/2\1/' -e 's/^\(cask\)/3\1/' | LC_ALL='C' command sort -f | {
command brew bundle dump --all --cask --debug --describe --file=- --force --formula --mas --no-restart --tap --verbose --vscode --whalebrew | command sed -e '$! N' -e '/^#.*\n[^#]/ s/\n/\t/' -e 'P' -e 'D' | command awk -F '\t' -- '{print $2 $1}' | command sed -e 's/^\(tap\)/1\1/' -e 's/^\(brew\)/2\1/' -e 's/^\(cask\)/3\1/' | LC_ALL='C' command sort -f | {
command printf -- '#!/usr/bin/env ruby\n'
command sed -e 's/^[[:digit:]]//' -e 's/\([^#]*\)\(#.*\)/\2\n\1/'
} >"${HOME%/}"'/.Brewfile'
Expand Down

0 comments on commit df8d226

Please sign in to comment.