From 4fb0da7daf68cf1cb8dac983d399e62794ff4f60 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Thu, 29 Dec 2022 17:10:04 +0100 Subject: [PATCH] changelog script --- script/changelog.clj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 script/changelog.clj diff --git a/script/changelog.clj b/script/changelog.clj new file mode 100755 index 0000000..adcc2ed --- /dev/null +++ b/script/changelog.clj @@ -0,0 +1,17 @@ +#!/usr/bin/env bb + +(ns changelog + (:require [clojure.string :as str])) + +(let [changelog (slurp "CHANGELOG.md") + replaced (str/replace changelog + #" #(\d+)" + (fn [[_ issue after]] + (format " [#%s](https://github.com/babashka/pods/issues/%s)%s" + issue issue (str after)))) + replaced (str/replace replaced + #"@([a-zA-Z0-9-_]+)([, \.)])" + (fn [[_ name after]] + (format "[@%s](https://github.com/%s)%s" + name name after)))] + (spit "CHANGELOG.md" replaced))