Add automatic updates for env-termuc now that it's working in env-shared.
This commit is contained in:
21
bashrc.sh
21
bashrc.sh
@@ -360,17 +360,24 @@ alias prod-pull="pull_prod_backups"
|
|||||||
eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
|
eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
|
||||||
|
|
||||||
# Run update checker in background.
|
# 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" fetch >/dev/null 2>&1 \
|
||||||
&& git -C "$PROJECT_TERMUX" status \
|
&& git -C "$PROJECT_TERMUX" status \
|
||||||
| grep "is behind" \
|
| grep "is behind" \
|
||||||
| while read status; do
|
| while read status; do
|
||||||
#log "\n\n`date` - env-termux has has been improved."
|
title=TBD
|
||||||
#log " '$status'"
|
message=TBD
|
||||||
#log "\n\n`date` - Run 'reload-termux' to update."
|
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"
|
title="env-termux Updates Available"
|
||||||
message="Update with 'reload-termux'."
|
message="Update with 'reload-termux'."
|
||||||
|
fi
|
||||||
if [[ -d /sdcard ]]; then
|
if [[ -d /sdcard ]]; then
|
||||||
termux-notification \
|
termux-notification \
|
||||||
-t "$title" \
|
-t "$title" \
|
||||||
@@ -379,7 +386,9 @@ eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
|
|||||||
notify-send "$title" "$message"
|
notify-send "$title" "$message"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi & )
|
fi
|
||||||
|
) >> "$HOME"/Reports/env-termux.log 2>&1 &
|
||||||
|
)
|
||||||
|
|
||||||
# Complete!
|
# Complete!
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
|
|||||||
Reference in New Issue
Block a user