fetchgitlab: escape rev to support "+" in it

This commit is contained in:
Florian Klink 2020-05-24 21:40:41 +02:00
parent 2226972c7a
commit 9b7a4694a0
1 changed files with 2 additions and 1 deletions

View File

@ -12,10 +12,11 @@ let
((optional (group != null) group) ++ [ owner repo ]); ((optional (group != null) group) ++ [ owner repo ]);
escapedSlug = replaceStrings ["." "/"] ["%2E" "%2F"] slug; escapedSlug = replaceStrings ["." "/"] ["%2E" "%2F"] slug;
escapedRev = replaceStrings ["+"] ["%2B"] rev;
in in
fetchzip ({ fetchzip ({
inherit name; inherit name;
url = "https://${domain}/api/v4/projects/${escapedSlug}/repository/archive.tar.gz?sha=${rev}"; url = "https://${domain}/api/v4/projects/${escapedSlug}/repository/archive.tar.gz?sha=${escapedRev}";
meta.homepage = "https://${domain}/${slug}/"; meta.homepage = "https://${domain}/${slug}/";
} // removeAttrs args [ "domain" "owner" "group" "repo" "rev" ]) // { inherit rev; } } // removeAttrs args [ "domain" "owner" "group" "repo" "rev" ]) // { inherit rev; }