commit
87a8a597e6
@ -149,9 +149,11 @@ rec {
|
||||
echo -n "$text" > "$target"
|
||||
fi
|
||||
|
||||
eval "$checkPhase"
|
||||
if [ -n "$executable" ]; then
|
||||
chmod +x "$target"
|
||||
fi
|
||||
|
||||
(test -n "$executable" && chmod +x "$target") || true
|
||||
eval "$checkPhase"
|
||||
'';
|
||||
|
||||
/*
|
||||
@ -412,7 +414,10 @@ rec {
|
||||
mkdir -p "$(dirname "$file")"
|
||||
cat $files > "$file"
|
||||
|
||||
(test -n "$executable" && chmod +x "$file") || true
|
||||
if [ -n "$executable" ]; then
|
||||
chmod +x "$file"
|
||||
fi
|
||||
|
||||
eval "$checkPhase"
|
||||
'';
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
{ lib, writeShellScript }: let
|
||||
output = "hello";
|
||||
in (writeShellScript "test-script" ''
|
||||
echo ${lib.escapeShellArg output}
|
||||
'').overrideAttrs (old: {
|
||||
checkPhase = old.checkPhase or "" + ''
|
||||
expected=${lib.escapeShellArg output}
|
||||
got=$("$target")
|
||||
if [[ "$got" != "$expected" ]]; then
|
||||
echo "wrong output: expected $expected, got $got"
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
})
|
@ -70,6 +70,7 @@ with pkgs;
|
||||
trivial-builders = recurseIntoAttrs {
|
||||
writeStringReferencesToFile = callPackage ../build-support/trivial-builders/test/writeStringReferencesToFile.nix {};
|
||||
writeTextFile = callPackage ../build-support/trivial-builders/test/write-text-file.nix {};
|
||||
writeShellScript = callPackage ../build-support/trivial-builders/test/write-shell-script.nix {};
|
||||
references = callPackage ../build-support/trivial-builders/test/references.nix {};
|
||||
overriding = callPackage ../build-support/trivial-builders/test-overriding.nix {};
|
||||
concat = callPackage ../build-support/trivial-builders/test/concat-test.nix {};
|
||||
|
Loading…
Reference in New Issue
Block a user