geany/scripts/github-news
2016-11-13 18:15:45 +01:00

23 lines
408 B
Bash
Executable File

#!/bin/sh
# Converts the last NEWS entry to GitHub format
sed -n -e '
n
:next
# stop at the second header
/^[A-Za-z0-9_-]/q
# strip the leading indentation
s/^ //
# Make titles
s/^[A-Za-z0-9_-]/## \0/
# Turn PR and Issue references to links
s%PR#\([0-9]\{1,\}\)%[\0](https://github.com/geany/geany/pull/\1)%g
s%Issue#\([0-9]\{1,\}\)%[\0](https://github.com/geany/geany/issue/\1)%g
p
n
b next
' < NEWS