diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b8b976..50e5848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,6 @@ # Change Log -## [v1.4.0](https://github.com/jonathanpoelen/gh-md-toc/tree/v -vers) (2019-07-27) +## [v1.4.0](https://github.com/jonathanpoelen/gh-md-toc/tree/v1.4.0) (2019-07-27) - new format: `{=0:pad:expr}` padding of the size of expr - enables `--all-title` if no TOC label is found diff --git a/tag.sh b/tag.sh index f701a92..b031513 100755 --- a/tag.sh +++ b/tag.sh @@ -9,7 +9,11 @@ if [ $# -lt 3 ] ; then exit 1 fi +TMPDIR=${TMPDIR:-/tmp} +EDITOR=${EDITOR:-nano} + projectname='gh-md-toc' +change="$TMPDIR/gh-md-toc-change.txt" oldfile=(*.rockspec) oldfile=${oldfile[0]} old_rock_vers=${oldfile:$((${#projectname}+1)):-9} @@ -17,12 +21,22 @@ new_rock_vers="$1.$2-$3" new_std_vers="$1.$2.$3" newfile="$projectname-$new_rock_vers.rockspec" +echo "# Change Log + +## [v$new_std_vers](https://github.com/jonathanpoelen/gh-md-toc/tree/v$new_std_vers) ($(date +'%Y-%m-%d')) + +- " > "$change" +"$EDITOR" "$change" +tail -n+2 CHANGELOG.md >> "$change" +cat "$change" +mv "$change" CHANGELOG.md + sed -i "s/^ print('gh-md-toc .*/ print('gh-md-toc $new_std_vers')/" gh-md-toc.lua sed -i "s/$old_rock_vers/$new_rock_vers/;s/${old_rock_vers/-/\\.}/$new_std_vers/" "$oldfile" sed -i "s/${oldfile//./\\.}/$newfile/" README.md mv "$oldfile" "$newfile" -git add "$oldfile" "$newfile" README.md gh-md-toc.lua +git add "$oldfile" "$newfile" README.md CHANGELOG.md gh-md-toc.lua git commit -vm "update version to $new_std_vers" git tag "v$new_std_vers" git push --tags