File tree Expand file tree Collapse file tree 6 files changed +29
-31
lines changed Expand file tree Collapse file tree 6 files changed +29
-31
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ examples:
50
50
# # before running anything else.
51
51
# #
52
52
# # You can safely delete this file if you do not need it.
53
- trap 'stacktrace' ERR
54
- set -o errtrace
53
+ enable_stacktrace
55
54
56
55
````
57
56
@@ -118,8 +117,8 @@ Examples:
118
117
119
118
Stack trace:
120
119
from ./download:15 in ` root_command`
121
- from ./download:254 in ` run`
122
- from ./download:260 in ` main`
120
+ from ./download:260 in ` run`
121
+ from ./download:266 in ` main`
123
122
124
123
125
124
````
Original file line number Diff line number Diff line change 4
4
# # before running anything else.
5
5
# #
6
6
# # You can safely delete this file if you do not need it.
7
- trap ' stacktrace' ERR
8
- set -o errtrace
7
+ enable_stacktrace
Original file line number Diff line number Diff line change 4
4
# # Usage:
5
5
# # This function is designed to be called on error.
6
6
# #
7
- # # To enable this functionality, add these lines to your `src/initialize.sh`
8
- # # file (Run `bashly add hooks` to add this file):
9
- # #
10
- # # trap 'stacktrace' ERR
11
- # # set -o errtrace
12
- # #
13
- # # Note that this functionality also requires `set -e`, which is enabled by
14
- # # default in bashly generated scripts.
7
+ # # To enable this functionality, call `enable_stacktrace` in your
8
+ # # `src/initialize.sh` (Run `bashly add hooks` to add this file).
15
9
# #
10
+ enable_stacktrace () {
11
+ trap ' stacktrace' ERR
12
+ set -o errtrace
13
+ set -o errexit
14
+ }
15
+
16
16
stacktrace () {
17
17
local exit_status=" $? "
18
18
local i=0
Original file line number Diff line number Diff line change @@ -110,10 +110,10 @@ stacktrace:
110
110
post_install_message : |
111
111
The stacktrace function is designed to be called automatically on error.
112
112
113
- To enable this functionality, add these lines to your `initialize.sh`:
114
-
115
- g`trap 'stacktrace' ERR`
116
- g`set -o errtrace `
113
+ To enable this functionality, call g`enable_stacktrace` in your
114
+ g`src/initialize.sh`. You may run the following command to add this file:
115
+
116
+ m`$ bashly add hooks `
117
117
118
118
strings :
119
119
help : Copy an additional configuration file to your project, allowing you to customize all the tips and error strings.
Original file line number Diff line number Diff line change 4
4
# # Usage:
5
5
# # This function is designed to be called on error.
6
6
# #
7
- # # To enable this functionality, add these lines to your `src/initialize.sh`
8
- # # file (Run `bashly add hooks` to add this file):
9
- # #
10
- # # trap 'stacktrace' ERR
11
- # # set -o errtrace
12
- # #
13
- # # Note that this functionality also requires `set -e`, which is enabled by
14
- # # default in bashly generated scripts.
7
+ # # To enable this functionality, call `enable_stacktrace` in your
8
+ # # `src/initialize.sh` (Run `bashly add hooks` to add this file).
15
9
# #
10
+ enable_stacktrace () {
11
+ trap ' stacktrace' ERR
12
+ set -o errtrace
13
+ set -o errexit
14
+ }
15
+
16
16
stacktrace () {
17
17
local exit_status=" $? "
18
18
local i=0
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ created src/lib/stacktrace.sh
3
3
4
4
The stacktrace function is designed to be called automatically on error.
5
5
6
- To enable this functionality, add these lines to your `initialize.sh`:
6
+ To enable this functionality, call enable_stacktrace in your
7
+ src/initialize.sh. You may run the following command to add this file:
7
8
8
- trap 'stacktrace' ERR
9
- set -o errtrace
9
+ $ bashly add hooks
10
10
11
11
+ bashly generate
12
12
creating user files in src
@@ -51,5 +51,5 @@ Examples:
51
51
52
52
Stack trace:
53
53
from ./download:15 in `root_command`
54
- from ./download:255 in `run`
55
- from ./download:261 in `main`
54
+ from ./download:260 in `run`
55
+ from ./download:266 in `main`
You can’t perform that action at this time.
0 commit comments