trap background processes

This commit is contained in:
Denis Lehmann 2023-10-14 12:43:37 +02:00
parent 07d8849432
commit acc2344004

2
gis
View file

@ -112,6 +112,7 @@ if [ "$fetch" == true ]; then
# Fetch all Git repositories in background
git fetch --prune --all 1> /dev/null 2> >(trap "" INT TERM; sed "s/^/${text_bold}${text_blue}${repository_name}${text_reset} /" >&2) &
fetch_pids+=("$!")
trap 'kill $!' INT
done
for pid in "${fetch_pids[@]}"; do
@ -149,6 +150,7 @@ if [ "$pull" == true ]; then
git pull 1> /dev/null 2> >(trap "" INT TERM; sed "s/^/${text_bold}${text_magenta}${repository_name}${text_reset} /" >&2) &
pull_pids+=("$!")
trap 'kill $!' INT
done
for pid in "${pull_pids[@]}"; do