From 6940f50ea7610af9da62b48d2054ac2011914514 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 15 Nov 2021 20:42:46 +0100 Subject: [PATCH] add 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..4a4ea04 --- /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/fs/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))