Add automatic updates for env-termuc now that it's working in env-shared.

This commit is contained in:
2026-05-06 17:52:02 -07:00
parent 2de6e77d40
commit 6834d85fc2

View File

@@ -360,17 +360,24 @@ 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
(
(
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=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" \
@@ -379,7 +386,9 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
notify-send "$title" "$message"
fi
done
fi & )
fi
) >> "$HOME"/Reports/env-termux.log 2>&1 &
)
# Complete!
PROG="$(basename -- "${BASH_SOURCE[0]}")"