From 6834d85fc202f674176882833104eb739b08e074 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 6 May 2026 17:52:02 -0700 Subject: [PATCH] Add automatic updates for env-termuc now that it's working in env-shared. --- bashrc.sh | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/bashrc.sh b/bashrc.sh index 0fc34d1..24cfedd 100755 --- a/bashrc.sh +++ b/bashrc.sh @@ -360,26 +360,35 @@ alias prod-pull="pull_prod_backups" eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')" # Run update checker in background. -( if [[ -d "$PROJECT_TERMUX" ]]; then - git -C "$PROJECT_TERMUX" fetch >/dev/null 2>&1 \ - && git -C "$PROJECT_TERMUX" status \ - | grep "is behind" \ - | while read status; do - #log "\n\n`date` - env-termux has has been improved." - #log " '$status'" - #log "\n\n`date` - Run 'reload-termux' to update." - - title="env-termux Updates Available" - message="Update with 'reload-termux'." - if [[ -d /sdcard ]]; then - termux-notification \ - -t "$title" \ - -c "$message" - else - notify-send "$title" "$message" +( + ( + if [[ -d "$PROJECT_TERMUX" ]]; then + git -C "$PROJECT_TERMUX" fetch >/dev/null 2>&1 \ + && git -C "$PROJECT_TERMUX" status \ + | grep "is behind" \ + | while read status; do + title=TBD + message=TBD + success=0 + reload-termux || success=1 + if [[ $success == 0 ]]; then + title="env-termux Updated" + message="Reloaded automatically, please reload BASH. :)" + else + title="env-termux Updates Available" + message="Update with 'reload-termux'." + fi + if [[ -d /sdcard ]]; then + termux-notification \ + -t "$title" \ + -c "$message" + else + notify-send "$title" "$message" + fi + done fi - done -fi & ) + ) >> "$HOME"/Reports/env-termux.log 2>&1 & +) # Complete! PROG="$(basename -- "${BASH_SOURCE[0]}")"