Skip to content

Commit af2417f

Browse files
committed
ci/eval: seperate different outputs in json
1 parent 8a5ee19 commit af2417f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ci/eval-nixpkgs.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,23 @@ main() {
6666
free -g >&2
6767
sleep 20
6868
done
69-
jq --raw-input --slurp 'split("\n") | map(select(. != "") | split(" ") | map(select(. != "")) | { key: .[0], value: .[1] }) | from_entries' "$tmpdir/paths"
69+
70+
# Extract derivation outputs for each attribute into a JSON object
71+
# i.e. { "attr1": { "out": "/nix/store/...", "dev": "/nix/store/..." }, ... }
72+
jq --raw-input --slurp '
73+
split("\n") |
74+
map(select(. != "") | split(" ") | map(select(. != ""))) |
75+
map(
76+
{
77+
key: .[0],
78+
value: .[1] | split(";") | map(split("=") |
79+
if length == 1 then
80+
{ key: "out", value: .[0] }
81+
else
82+
{ key: .[0], value: .[1] }
83+
end) | from_entries}
84+
) | from_entries
85+
' "$tmpdir/paths"
7086
exit "$(cat "$tmpdir/exit-code")"
7187
}
7288

0 commit comments

Comments
 (0)