Move the update checker to be after all functions are declared so that log works properly.

This commit is contained in:
2026-04-25 08:17:29 -07:00
parent 0c54259a38
commit 79a35be993

View File

@@ -138,13 +138,6 @@ function update-shared2 {
alias shared-update2="update-shared2"
alias reload-shared2="update-shared2"
alias shared-reload2="update-shared2"
( if [[ -d "$project" ]]; then
git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \
| while read status; do
log "\n\n`date` - Updates to env-shared are available via 'update-shared2'."
log " '$status'"
done
fi & )
# Shortcuts #
@@ -518,6 +511,16 @@ alias pa="v2a"
eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
# Run update checker in background.
( if [[ -d "$project" ]]; then
git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \
| while read status; do
log "\n\n`date` - Updates to env-shared are available via 'update-shared2'."
log " '$status'"
done
fi & )
## Complete! ##
[[ $(whoami) != "root" ]] &&