diff options
author | Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> | 2022-03-17 10:55:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-17 10:55:22 +0100 |
commit | a0b517de5796d9a82b18242ecc63f507869237b1 (patch) | |
tree | ca111de239053f6aafccf78cd7ddb56ca1e79192 /tests | |
parent | fe1ad9613561ea78b6d97cf82c03d2dd77e43f69 (diff) | |
parent | c20e07763d84c9dc6f8d06993335c765ba514aca (diff) |
Merge pull request #6242 from ncfavier/print-output-names
nix-env: always print output names in JSON and XML
Diffstat (limited to 'tests')
-rw-r--r-- | tests/user-envs.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/user-envs.sh b/tests/user-envs.sh index 430688de1..d63fe780a 100644 --- a/tests/user-envs.sh +++ b/tests/user-envs.sh @@ -17,6 +17,16 @@ outPath10=$(nix-env -f ./user-envs.nix -qa --out-path --no-name '*' | grep foo-1 drvPath10=$(nix-env -f ./user-envs.nix -qa --drv-path --no-name '*' | grep foo-1.0) [ -n "$outPath10" -a -n "$drvPath10" ] +# Query with json +nix-env -f ./user-envs.nix -qa --json | jq -e '.[] | select(.name == "bar-0.1") | [ + .outputName == "out", + .outputs.out == null +] | all' +nix-env -f ./user-envs.nix -qa --json --out-path | jq -e '.[] | select(.name == "bar-0.1") | [ + .outputName == "out", + (.outputs.out | test("'$NIX_STORE_DIR'.*-0\\.1")) +] | all' + # Query descriptions. nix-env -f ./user-envs.nix -qa '*' --description | grep -q silly rm -rf $HOME/.nix-defexpr |