Skip to content

Commit 3767b3f

Browse files
committed
Fix typos
1 parent 256a6e4 commit 3767b3f

4 files changed

Lines changed: 21 additions & 22 deletions

File tree

docs/api.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Core functions for any Bash program
3434

3535
### core.trap_add
3636

37-
Adds a handler for a particular `trap` signal or event. Noticably,
37+
Adds a handler for a particular `trap` signal or event. Noticeably,
3838
unlike the 'builtin' trap, this does not override any other existing handlers. The first argument
3939
to the handler is the exit code of the last command that ran before the particular 'trap'
4040

@@ -49,7 +49,7 @@ core.trap_remove 'some_handler' 'USR1'
4949

5050
#### Arguments
5151

52-
* **$1** (string): Function to execute on an event. Integers are forbiden
52+
* **$1** (string): Function to execute on an event. Integers are forbidden
5353
* **$2** (string): Event signal
5454

5555
### core.trap_remove
@@ -118,7 +118,7 @@ Prints stacktrace
118118
err_handler() {
119119
local exit_code=$1 # Note that this isn't `$?`
120120
core.print_stacktrace
121-
121+
122122
# Note that we're not doing `exit $exit_code` because
123123
# that is handled automatically
124124
}
@@ -295,4 +295,3 @@ of the callee to standard error and die
295295
#### Arguments
296296

297297
* **$1** (string): message
298-

pkg/src/public/bash-core.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# @name bash-core
44
# @description Core functions for any Bash program
55

6-
# @description Adds a handler for a particular `trap` signal or event. Noticably,
6+
# @description Adds a handler for a particular `trap` signal or event. Noticeably,
77
# unlike the 'builtin' trap, this does not override any other existing handlers. The first argument
88
# to the handler is the exit code of the last command that ran before the particular 'trap'
9-
# @arg $1 string Function to execute on an event. Integers are forbiden
9+
# @arg $1 string Function to execute on an event. Integers are forbidden
1010
# @arg $2 string Event signal
1111
# @example
1212
# some_handler() { printf '%s\n' 'This was called on USR1! ^w^'; }

tests/shopt.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
load './util/init.sh'
44

5-
@test "core.shotpt_push works" {
5+
@test "core.shopt_push works" {
66
shopt -u extglob
77

88
core.shopt_push -s extglob

tests/trap.bats

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ load './util/init.sh'
1010
# ___global_trap_table___ is an associative array. If that variable is not an associative
1111
# array, indexing with 'nokey' still yields the value of the (string) variable (no error
1212
# will be thrown). Now that 'core.init' is automatically called when the array is not
13-
# defined (to be an associative array), these checks are unecessary (yet, they still exist)
13+
# defined (to be an associative array), these checks are unnecessary (yet, they still exist)
1414

1515
@test "core.trap_add fails when function is not supplied" {
1616
run core.trap_add '' 'USR1'
@@ -20,7 +20,7 @@ load './util/init.sh'
2020
}
2121

2222
@test "core.trap_add fails when signal is not supplied" {
23-
run core.trap_add 'function'
23+
run core.trap_add 'function'
2424

2525
assert_failure
2626
assert_output -p "Must specify at least one signal"
@@ -51,7 +51,7 @@ load './util/init.sh'
5151
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
5252
cd \"\$BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
5353
source ./util/init.sh
54-
54+
5555
somefunction() { printf '%s\n' 'a'; }
5656
core.trap_add 'somefunction' 'USR1'
5757
kill -USR1 \$\$"
@@ -72,7 +72,7 @@ load './util/init.sh'
7272
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
7373
cd \"\$BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
7474
source ./util/init.sh
75-
75+
7676
somefunction() { printf '%s\n' 'a'; }
7777
somefunction2() { printf '%s\n' 'b'; }
7878
core.trap_add 'somefunction' 'USR1'
@@ -93,11 +93,11 @@ load './util/init.sh'
9393
[ "${___global_trap_table___[USR1]}" = $'\x1Csomefunction\x1Csomefunction2' ]
9494
}
9595

96-
@test "core.trap_add adds function properly 3" {
96+
@test "core.trap_add adds function properly 3" {
9797
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
9898
cd \"\$BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
9999
source ./util/init.sh
100-
100+
101101
somefunction() { printf '%s\n' 'a'; }
102102
core.trap_add 'somefunction' 'USR1' 'USR2'
103103
kill -USR1 \$\$
@@ -110,7 +110,7 @@ load './util/init.sh'
110110
@test "core.trap_add adds function properly 3 (variable)" {
111111
somefunction() { :; }
112112
core.trap_add 'somefunction' 'USR1' 'USR2'
113-
113+
114114
[ "${___global_trap_table___[nokey]}" != $'\x1Csomefunction' ]
115115
[ "${___global_trap_table___[USR1]}" = $'\x1Csomefunction' ]
116116
[ "${___global_trap_table___[USR2]}" = $'\x1Csomefunction' ]
@@ -124,7 +124,7 @@ load './util/init.sh'
124124
}
125125

126126
@test "core.trap_remove fails when signal is not supplied" {
127-
run core.trap_remove 'function'
127+
run core.trap_remove 'function'
128128

129129
assert_failure
130130
assert_output -p "Must specify at least one signal"
@@ -148,7 +148,7 @@ load './util/init.sh'
148148
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
149149
cd \"\$BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
150150
source ./util/init.sh
151-
151+
152152
somefunction() { printf '%s\n' 'a'; }
153153
core.trap_add 'somefunction' 'USR1'
154154
core.trap_remove 'somefunction' 'USR1'
@@ -171,7 +171,7 @@ load './util/init.sh'
171171
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
172172
cd \"\$BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
173173
source ./util/init.sh
174-
174+
175175
somefunction() { printf '%s\n' 'a'; }
176176
somefunction2() { printf '%s\n' 'b'; }
177177
core.trap_add 'somefunction' 'USR1'
@@ -198,7 +198,7 @@ load './util/init.sh'
198198
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
199199
cd \"\$BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
200200
source ./util/init.sh
201-
201+
202202
somefunction() { printf '%s\n' 'a'; }
203203
somefunction2() { printf '%s\n' 'b'; }
204204
core.trap_add 'somefunction' 'USR1'
@@ -226,7 +226,7 @@ load './util/init.sh'
226226
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
227227
cd \"\$BASALT_PACKAGE_DIR/tests\" || { printf '%s\n' 'Failed to cd'; exit 1; }
228228
source ./util/init.sh
229-
229+
230230
somefunction() { printf '%s\n' 'a'; }
231231
somefunction2() { printf '%s\n' 'b'; }
232232
core.trap_add 'somefunction' 'USR1'
@@ -253,7 +253,7 @@ load './util/init.sh'
253253
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
254254
cd \"\$BASALT_PACKAGE_DIR/tests\"
255255
source ./util/init.sh
256-
256+
257257
somefunction() { return 33; }
258258
core.trap_add 'somefunction' 'USR1'
259259
kill -USR1 \$\$
@@ -267,7 +267,7 @@ load './util/init.sh'
267267
BASALT_PACKAGE_DIR=$BASALT_PACKAGE_DIR run bash -c "
268268
cd \"\$BASALT_PACKAGE_DIR/tests\"
269269
source ./util/init.sh
270-
270+
271271
somefunction() { return 33; }
272272
core.trap_add 'somefunction' 'USR1'
273273
unset -f somefunction
@@ -276,4 +276,4 @@ load './util/init.sh'
276276

277277
assert_success
278278
assert_output -p "Trap handler function 'somefunction' that was registered for signal 'USR1' no longer exists"
279-
}
279+
}

0 commit comments

Comments
 (0)