Skip to content

Commit

Permalink
dvt: remove nounset bash opt
Browse files Browse the repository at this point in the history
`writeShellApplication` has `[ "errexit" "nounset" "pipefail" ]`
set for its `bashOptions` parameter. This sets these at the top
of every generated script.

The error message `"no template specified"` is never printed since
the script immediately dies because `${1}` isn't set and `nounset`
is enabled. Excluding the option from the script generation allows
the error message to print rather than just
`result/bin/dvt: line 6: 1: unbound variable` which isn't helpful.
  • Loading branch information
sebaszv committed Nov 6, 2024
1 parent dec0902 commit 078145d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

dvt = final.writeShellApplication {
name = "dvt";
bashOptions = [ "errexit" "pipefail" ];
text = ''
if [ -z "''${1}" ]; then
echo "no template specified"
Expand Down

0 comments on commit 078145d

Please sign in to comment.