babashka/script/changelog.clj

18 lines
697 B
Clojure
Raw Normal View History

2020-05-30 20:12:29 +00:00
#!/usr/bin/env bb
(ns changelog
(:require [clojure.string :as str]))
(let [changelog (slurp "CHANGELOG.md")
replaced (str/replace changelog
2020-06-10 21:54:48 +00:00
#" #(\d+)"
2020-05-30 20:12:29 +00:00
(fn [[_ issue after]]
2020-06-10 21:54:48 +00:00
(format " [#%s](https://github.com/borkdude/babashka/issues/%s)%s"
2020-06-10 22:13:47 +00:00
issue issue (str after))))
2020-06-01 08:56:00 +00:00
replaced (str/replace replaced
2020-06-10 21:54:48 +00:00
#"@(\w+)([, .\)])"
2020-06-01 08:56:00 +00:00
(fn [[_ name after]]
(format "[@%s](https://github.com/%s)%s"
name name after)))]
2020-05-30 20:12:29 +00:00
(spit "CHANGELOG.md" replaced))