tvl-depot/third_party/nix/tests/pass-as-file.sh
edef 48f08e8cc0 fix(3p/nix): passAsFile: leave out the hash prefix
Having a colon in the path may cause issues, and having the hash
function indicated isn't actually necessary. We now verify the path
format in the tests to prevent regressions.

(cherry picked from commit c65a6fa86aef7bdf51fb4fba7bd31d265619ba3f)
2020-05-31 19:20:24 +01:00

18 lines
396 B
Bash

source common.sh
clearStore
outPath=$(nix-build --no-out-link -E "
with import ./config.nix;
mkDerivation {
name = \"pass-as-file\";
passAsFile = [ \"foo\" ];
foo = [ \"xyzzy\" ];
builder = builtins.toFile \"builder.sh\" ''
[ \"\$(basename \$fooPath)\" = .attr-1bp7cri8hplaz6hbz0v4f0nl44rl84q1sg25kgwqzipzd1mv89ic ]
[ \"\$(cat \$fooPath)\" = xyzzy ]
touch \$out
'';
}
")