File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,23 @@ main() {
66
66
free -g >&2
67
67
sleep 20
68
68
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"
70
86
exit " $( cat " $tmpdir /exit-code" ) "
71
87
}
72
88
You can’t perform that action at this time.
0 commit comments