lock: 1.3.0 -> 1.3.4 (#364295)
[NixPkgs.git] / pkgs / build-support / trivial-builders / test / write-shell-script.nix
blob2e20588fad6b8c123e0d9190899d56bf4718af47
1 { lib, writeShellScript }:
2 let
3   output = "hello";
4 in
5 (writeShellScript "test-script" ''
6   echo ${lib.escapeShellArg output}
7 '').overrideAttrs
8   (old: {
9     checkPhase =
10       old.checkPhase or ""
11       + ''
12         expected=${lib.escapeShellArg output}
13         got=$("$target")
14         if [[ "$got" != "$expected" ]]; then
15           echo "wrong output: expected $expected, got $got"
16           exit 1
17         fi
18       '';
19   })