Add URL field to JSON builds #223

Merged
quentin merged 1 commit from json-build-add-urls into feature/generate-json-builds 2022-02-05 18:08:52 +00:00
Showing only changes of commit 38bb74bfd8 - Show all commits

View file

@ -55,7 +55,7 @@ let
parsed = map (entry: listToSet keys entry) elems; parsed = map (entry: listToSet keys entry) elems;
subkeys = ["root" "version" "platform" "binary" ]; subkeys = ["root" "version" "platform" "binary" ];
builds = map (entry: entry // listToSet subkeys (lib.splitString "/" entry.path)) parsed; builds = map (entry: entry // listToSet subkeys (lib.splitString "/" entry.path) // { url = "https://garagehq.deuxfleurs.fr/" + entry.path; }) parsed;
/* Aggregation */ /* Aggregation */
builds_per_version = lib.foldl (acc: v: acc // { ${v.version} = if builtins.hasAttr v.version acc then acc.${v.version} ++ [ v ] else [ v ]; }) {} builds; builds_per_version = lib.foldl (acc: v: acc // { ${v.version} = if builtins.hasAttr v.version acc then acc.${v.version} ++ [ v ] else [ v ]; }) {} builds;