polybar-dwm/bump.sh

31 lines
871 B
Bash
Raw Normal View History

2016-06-14 03:39:17 +00:00
#!/bin/sh
2016-06-28 12:50:21 +00:00
# Use passed argument as new tag
if [ $# -eq 0 ]; then
version=$(git describe --tags --abbrev=0)
patch=${version##*.}
set -- "${version%.*}.$((patch+1))"
fi
git tag "$@" || exit 1
2016-06-28 12:50:21 +00:00
2016-12-21 23:23:00 +00:00
tag_curr="$(git tag --sort=version:refname | tail -1)"
tag_prev="$(git tag --sort=version:refname | tail -2 | head -1)"
2016-06-14 03:39:17 +00:00
2016-06-28 13:24:23 +00:00
./version.sh "$tag_curr"
sed -r "s/${tag_prev}/${tag_curr}/g" -i \
README.md CMakeLists.txt \
2016-11-19 05:22:44 +00:00
contrib/polybar.aur/PKGBUILD contrib/polybar.aur/.SRCINFO \
contrib/polybar-git.aur/PKGBUILD contrib/polybar-git.aur/.SRCINFO
git add -u README.md CMakeLists.txt \
2016-11-19 05:22:44 +00:00
contrib/polybar.aur/PKGBUILD contrib/polybar.aur/.SRCINFO \
contrib/polybar-git.aur/PKGBUILD contrib/polybar-git.aur/.SRCINFO \
include/version.hpp
2016-06-14 03:39:17 +00:00
git commit -m "build: Bump version to ${tag_curr}"
2016-06-28 12:50:21 +00:00
# Recreate the tag to include the last commit
[ $# -eq 1 ] && git tag -f "$@"