update-bash: kill all of subprocess on interrupt when fetching

This commit is contained in:
Xu Cheng 2016-01-21 13:32:22 +08:00
parent 2d84fc56fe
commit 2f52ca9ded

View File

@ -293,6 +293,9 @@ EOS
# this procedure will be removed in the future if it seems unnecessary # this procedure will be removed in the future if it seems unnecessary
rename_taps_dir_if_necessary rename_taps_dir_if_necessary
# kill all of subprocess on interrupt
trap '{ pkill -P $$; wait; exit 130; }' SIGINT
for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/* for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
do do
[[ -d "$DIR/.git" ]] || continue [[ -d "$DIR/.git" ]] || continue
@ -306,6 +309,7 @@ EOS
done done
wait wait
trap - SIGINT
for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/* for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
do do