prel: ajout de l'option --uc pour convertir CHANGES.txt en CHANGES.md

This commit is contained in:
Jephté Clain 2016-10-06 00:26:56 +04:00
parent f3ba5e3b7c
commit d2a56d6f1f
1 changed files with 10 additions and 0 deletions

10
prel
View File

@ -125,6 +125,7 @@ function show_summary() {
function format_md() { function format_md() {
awk ' awk '
$0 == "" || $0 ~ /^#/ { print; next }
$1 == "+" { $1 == "+" {
$1 = "*" $1 = "*"
$2 = "`" $2 "`" $2 = "`" $2 "`"
@ -177,6 +178,7 @@ parse_opts "${PRETTYOPTS[@]}" \
-s,--summary action=summary \ -s,--summary action=summary \
-l,--log '$action=diff; log=1' \ -l,--log '$action=diff; log=1' \
-d,--diff '$action=diff; diff=1' \ -d,--diff '$action=diff; diff=1' \
--upgrade-changes,--uc action=upgrade-changes \
@ args -- "$@" && set -- "${args[@]}" || die "$args" @ args -- "$@" && set -- "${args[@]}" || die "$args"
if [ "$action" == auto ]; then if [ "$action" == auto ]; then
@ -196,6 +198,14 @@ if [ -n "$projdir" ]; then
cd "$projdir" || die cd "$projdir" || die
fi fi
if [ "$action" == upgrade-changes ]; then
[ -f CHANGES.txt ] || die "CHANGES.txt: fichier introuvable"
format_md <CHANGES.txt >CHANGES.md || die
rm CHANGES.txt
enote "Conversion CHANGES.txt --> CHANGES.md effectuée"
exit 0
fi
git_ensure_gitvcs git_ensure_gitvcs
push_branches=() push_branches=()