prel: ajout de l'option --uc pour convertir CHANGES.txt en CHANGES.md
This commit is contained in:
parent
f3ba5e3b7c
commit
d2a56d6f1f
10
prel
10
prel
|
@ -125,6 +125,7 @@ function show_summary() {
|
|||
|
||||
function format_md() {
|
||||
awk '
|
||||
$0 == "" || $0 ~ /^#/ { print; next }
|
||||
$1 == "+" {
|
||||
$1 = "*"
|
||||
$2 = "`" $2 "`"
|
||||
|
@ -177,6 +178,7 @@ parse_opts "${PRETTYOPTS[@]}" \
|
|||
-s,--summary action=summary \
|
||||
-l,--log '$action=diff; log=1' \
|
||||
-d,--diff '$action=diff; diff=1' \
|
||||
--upgrade-changes,--uc action=upgrade-changes \
|
||||
@ args -- "$@" && set -- "${args[@]}" || die "$args"
|
||||
|
||||
if [ "$action" == auto ]; then
|
||||
|
@ -196,6 +198,14 @@ if [ -n "$projdir" ]; then
|
|||
cd "$projdir" || die
|
||||
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
|
||||
|
||||
push_branches=()
|
||||
|
|
Loading…
Reference in New Issue