Skip to content

Commit

Permalink
fix CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpoelen committed Jul 27, 2019
1 parent 5d4e8fa commit b8fb3ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 15 additions & 1 deletion tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,34 @@ 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}
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
Expand Down

0 comments on commit b8fb3ca

Please sign in to comment.