Ver código fonte

Merge pull request #417 from infosiftr/ctrl-c

Add a trap for Ctrl+C
yosifkit 11 anos atrás
pai
commit
2463f0932e
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      bashbrew/bashbrew.sh

+ 3 - 0
bashbrew/bashbrew.sh

@@ -1,6 +1,9 @@
 #!/bin/bash
 set -e
 
+# make sure we can GTFO
+trap 'echo >&2 Ctrl+C captured, exiting; exit 1' SIGINT
+
 # so we can have fancy stuff like !(pattern)
 shopt -s extglob