aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorXu Cheng2016-01-21 13:32:22 +0800
committerXu Cheng2016-01-21 21:14:55 +0800
commit2f52ca9dedae8f4e1fb144d54f9377ced3abd585 (patch)
treee7742ce07be51e91049b80eab369d84301a743c8 /Library/Homebrew/cmd
parent2d84fc56fe233b435b8d16ebc012e83155b45c09 (diff)
downloadbrew-2f52ca9dedae8f4e1fb144d54f9377ced3abd585.tar.bz2
update-bash: kill all of subprocess on interrupt when fetching
Diffstat (limited to 'Library/Homebrew/cmd')
-rwxr-xr-xLibrary/Homebrew/cmd/update-bash.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/update-bash.sh b/Library/Homebrew/cmd/update-bash.sh
index d38d6dc72..2b7e3d233 100755
--- a/Library/Homebrew/cmd/update-bash.sh
+++ b/Library/Homebrew/cmd/update-bash.sh
@@ -293,6 +293,9 @@ EOS
# this procedure will be removed in the future if it seems unnecessary
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/*/*
do
[[ -d "$DIR/.git" ]] || continue
@@ -306,6 +309,7 @@ EOS
done
wait
+ trap - SIGINT
for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
do