mirror of
https://github.com/ckb-next/ckb-next.git
synced 2026-10-10 12:27:21 -04:00
scripts: Add update_changelog.sh
It is of unknown quality and whether it actually works or not
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ $# -ne 3 ]]; then
|
||||||
|
echo "Usage $0 0 5 0"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOG=$(cat CHANGELOG.md | tail -n +2)
|
||||||
|
DATE=$(date +%F)
|
||||||
|
|
||||||
|
PREVPATCH=$(($3-1))
|
||||||
|
PREVMIN=$2
|
||||||
|
if [[ $PREVPATCH -lt 0 ]]; then
|
||||||
|
PREVMIN=$(($2-1))
|
||||||
|
PREVPATCH="FIXME"
|
||||||
|
echo "Warning: Previous version needs to be manually modified in [Full Changelog]"
|
||||||
|
fi
|
||||||
|
N=$'\n'
|
||||||
|
NEW="# Change Log${N}${N}## [v$1.$2.$3](https://github.com/ckb-next/ckb-next/tree/v$1.$2.$3) ($DATE)${N}[Full Changelog](https://github.com/ckb-next/ckb-next/compare/v$1.$PREVMIN.$PREVPATCH...v$1.$2.$3)${N}${N}Support for new devices:${N}- ${N}${N}Important bugfixes:${N}- ${N}${N}New features:${N}- ${N}${N}Notes for packagers:${N}- ${N}"
|
||||||
|
echo "${NEW}${LOG}" > CHANGELOG.md
|
||||||
Reference in New Issue
Block a user