Skip to content

Commit 7f5afa6

Browse files
committed
fix: Minor enhancement to get-publiccode-url
1 parent b5a04d4 commit 7f5afa6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/codegouvfr/codegouvfr_output_data.clj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,11 @@
9696
(defn- get-publiccode-url [awesome-repo]
9797
(let [{:keys [_ full_name default_branch platform]}
9898
(get-repo-properties awesome-repo)
99-
platform-prefixes
10099
;; FIXME: Provide a more generic solution
101-
{"github.com" #(format "https://raw.githubusercontent.com/%s/%s/" %1 %2)
102-
"gitlab.huma-num.fr" #(format "https://gitlab.huma-num.fr/%s/-/raw/%s/" %1 %2)}]
103-
(when-let [prefix-fn (get platform-prefixes platform)]
104-
(str (prefix-fn full_name default_branch) "publiccode.yml"))))
100+
url-format-string (if (= platform "github.com")
101+
"https://raw.githubusercontent.com/%s/%s/"
102+
(str "https://" platform "/%s/-/raw/%s/"))]
103+
(str (format url-format-string full_name default_branch) "publiccode.yml")))
105104

106105
(def owners-keys-mapping
107106
{:a :location

0 commit comments

Comments
 (0)