generated from me/template-mit
Move the update checker to be after all functions are declared so that log works properly.
This commit is contained in:
17
rc_shared.sh
17
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" ]] &&
|
||||
|
||||
Reference in New Issue
Block a user