From 79a35be993d3ba3c8cb91ae461965a4d16f24311 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 25 Apr 2026 08:17:29 -0700 Subject: [PATCH] Move the update checker to be after all functions are declared so that `log` works properly. --- rc_shared.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index 859135c..6b6cecb 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -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" ]] &&