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
|
|
|
|
|
#"#(\d+)(:? )"
|
|
|
|
|
(fn [[_ issue after]]
|
|
|
|
|
(format "[#%s](https://github.com/borkdude/babashka/issues/%s)%s"
|
2020-06-01 08:56:00 +00:00
|
|
|
issue issue after)))
|
|
|
|
|
replaced (str/replace replaced
|
|
|
|
|
#"@(\w+)([, .])"
|
|
|
|
|
(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))
|