mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-31 09:14:28 +00:00
writeShellApplication: Add bashOptions
argument
This commit is contained in:
parent
185474c3ec
commit
ac20bcf449
@ -272,6 +272,7 @@ rec {
|
|||||||
, meta ? { }
|
, meta ? { }
|
||||||
, checkPhase ? null
|
, checkPhase ? null
|
||||||
, excludeShellChecks ? [ ]
|
, excludeShellChecks ? [ ]
|
||||||
|
, bashOptions ? [ "errexit" "nounset" "pipefail" ]
|
||||||
}:
|
}:
|
||||||
writeTextFile {
|
writeTextFile {
|
||||||
inherit name meta;
|
inherit name meta;
|
||||||
@ -281,9 +282,7 @@ rec {
|
|||||||
preferLocalBuild = false;
|
preferLocalBuild = false;
|
||||||
text = ''
|
text = ''
|
||||||
#!${runtimeShell}
|
#!${runtimeShell}
|
||||||
set -o errexit
|
${lib.concatMapStringsSep "\n" (option: "set -o ${option}") bashOptions}
|
||||||
set -o nounset
|
|
||||||
set -o pipefail
|
|
||||||
'' + lib.optionalString (runtimeInputs != [ ]) ''
|
'' + lib.optionalString (runtimeInputs != [ ]) ''
|
||||||
|
|
||||||
export PATH="${lib.makeBinPath runtimeInputs}:$PATH"
|
export PATH="${lib.makeBinPath runtimeInputs}:$PATH"
|
||||||
|
Loading…
Reference in New Issue
Block a user