forked from lix-project/lix
Add some tests for nix-env -q --json
This commit is contained in:
parent
8dcecc0738
commit
c20e07763d
|
@ -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)
|
drvPath10=$(nix-env -f ./user-envs.nix -qa --drv-path --no-name '*' | grep foo-1.0)
|
||||||
[ -n "$outPath10" -a -n "$drvPath10" ]
|
[ -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.
|
# Query descriptions.
|
||||||
nix-env -f ./user-envs.nix -qa '*' --description | grep -q silly
|
nix-env -f ./user-envs.nix -qa '*' --description | grep -q silly
|
||||||
rm -rf $HOME/.nix-defexpr
|
rm -rf $HOME/.nix-defexpr
|
||||||
|
|
Loading…
Reference in a new issue