1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Add --arg-from-stdin to read an argument from stdin

This commit is contained in:
Eelco Dolstra 2024-03-01 14:39:42 +01:00
parent 291b10c607
commit 8ce1f6800b
3 changed files with 16 additions and 1 deletions

View file

@ -49,3 +49,6 @@ printf 123 > $TEST_ROOT/xyzzy/default.nix
if [[ -e /proc/version ]]; then
[[ "$(nix eval --raw --arg-from-file foo /proc/version --expr '{ foo }: { inherit foo; }' foo)" = "$(cat /proc/version)" ]]
fi
# Test --arg-from-stdin.
[[ "$(echo bla | nix eval --raw --arg-from-stdin foo --expr '{ foo }: { inherit foo; }' foo)" = bla ]]