Skip to content

Commit ba87ef4

Browse files
authored
On error exit code is 1 as it always should have been (#10)
Fixes #9
1 parent 83ccd40 commit ba87ef4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ $ ./bash-env-json --shellfns f2,f3 ./tests/shell-functions.env | jq
9191

9292
## Exit Status
9393

94-
Detecting and returning errors in JSON is normal behaviour for `bash-env-json` which is why the exit code in such cases is `0` and not `1` as might otherwise be expected.
94+
Any error is returned in the JSON `error` field, and `bash-env-json` returns an exit code of `1` in the usual way.
9595

9696
## Tests
9797

bash-env-json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function emit_error() {
8383

8484
function emit_error_exit() {
8585
emit_error "$@" | jq
86-
exit 0
86+
exit 1
8787
}
8888

8989
function emit_help_exit() {

0 commit comments

Comments
 (0)