fix: Fail if build fails!

The pipefail option does not catch usage from subshells like this:

```
echo <<<"$(echo foo; exit 1)"
```

Since that's how `nix develop` is called in the script, when the action
could not build an environment, it would still be treated as having run
successfully, and the job would continue.

It's still hypothetically possible for this to happen if `env` or `bash
-c 'echo $PATH'` fail.  Seems unlikely!  But maybe there's something to
be done there.
This commit is contained in:
Nick Novitski 2023-10-19 10:15:04 -07:00
parent f33559582d
commit 2cd3e161f5

View file

@ -9,6 +9,8 @@ with_nix_develop() {
nix develop --ignore-environment "${arguments[@]}" --command "$@" nix develop --ignore-environment "${arguments[@]}" --command "$@"
} }
with_nix_develop true # Exit immediately if build fails
contains() { contains() {
grep "$1" --silent <<<"$2" grep "$1" --silent <<<"$2"
} }