script: stop on error by default
This commit is contained in:
parent
60248ab06b
commit
422d359b48
@ -5,8 +5,12 @@
|
|||||||
{
|
{
|
||||||
script
|
script
|
||||||
, shell ? "/bin/sh"
|
, shell ? "/bin/sh"
|
||||||
|
, exitOnError ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
setcmd = if exitOnError then "set -e" else "";
|
||||||
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "script";
|
name = "script";
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
@ -14,6 +18,7 @@ stdenv.mkDerivation {
|
|||||||
installPhase = ''
|
installPhase = ''
|
||||||
cat > $out <<'EOF'
|
cat > $out <<'EOF'
|
||||||
#!${shell}
|
#!${shell}
|
||||||
|
${setcmd}
|
||||||
|
|
||||||
${script}
|
${script}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user