script: stop on error by default

This commit is contained in:
Rodrigo Arias 2021-01-14 12:23:37 +01:00
parent 60248ab06b
commit 422d359b48

View File

@ -5,8 +5,12 @@
{
script
, shell ? "/bin/sh"
, exitOnError ? true
}:
let
setcmd = if exitOnError then "set -e" else "";
in
stdenv.mkDerivation {
name = "script";
preferLocalBuild = true;
@ -14,6 +18,7 @@ stdenv.mkDerivation {
installPhase = ''
cat > $out <<'EOF'
#!${shell}
${setcmd}
${script}