Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On error exit code is 1 as it always should have been #10

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ $ ./bash-env-json --shellfns f2,f3 ./tests/shell-functions.env | jq

## Exit Status

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.
Any error is returned in the JSON `error` field, and `bash-env-json` returns an exit code of `1` in the usual way.

## Tests

Expand Down
2 changes: 1 addition & 1 deletion bash-env-json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function emit_error() {

function emit_error_exit() {
emit_error "$@" | jq
exit 0
exit 1
}

function emit_help_exit() {
Expand Down