mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Merge pull request #6242 from ncfavier/print-output-names
nix-env: always print output names in JSON and XML
This commit is contained in:
commit
a0b517de57
5 changed files with 106 additions and 86 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue