File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ description = 'Core lightweight functions that any Bash programmer will love'
8
8
9
9
[run ]
10
10
dependencies = [' https://github.com/hyperupcall/bats-all.git@v4.1.0' ]
11
- sourceDirs = [' pkg/src/public' ]
11
+ sourceDirs = [' pkg/src/public' , ' pkg/src/util ' ]
12
12
builtinDirs = []
13
13
binDirs = []
14
14
completionDirs = []
Original file line number Diff line number Diff line change
1
+ # shellcheck shell=bash
2
+
3
+ core.trap_common_global_handler () {
4
+ local signal_spec=" $1 "
5
+
6
+ local trap_handlers=
7
+ IFS=$' \x1C ' read -ra trap_handlers <<< " ${___global_trap_table___[$signal_spec]}"
8
+
9
+ local trap_handler=
10
+ for trap_handler in " ${trap_handlers[@]} " ; do
11
+ if [ -z " $trap_handler " ]; then
12
+ continue
13
+ fi
14
+
15
+ if declare -f " $trap_handler " & > /dev/null; then
16
+ " $trap_handler "
17
+ else
18
+ printf " %s\n" " Warn: core.trap_add: Function '$trap_handler ' registered for signal '$signal_spec ' no longer exists. Skipping" >&2
19
+ fi
20
+ done ; unset trap_func
21
+ }
You can’t perform that action at this time.
0 commit comments