fix: Custom version by argument
This commit is contained in:
parent
4c83b363bf
commit
4d5851b3b3
9
bump.sh
9
bump.sh
@ -1,16 +1,19 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Use passed argument as new tag
|
# Use passed argument as new tag
|
||||||
[ $# -eq 1 ] && git tag "$@"
|
[ $# -eq 1 ] && {
|
||||||
|
git tag "$@" || exit 1
|
||||||
./version.sh
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
tag_prev=$(git tag -l | tail -2 | head -1)
|
tag_prev=$(git tag -l | tail -2 | head -1)
|
||||||
tag_curr=$(git tag -l | tail -1)
|
tag_curr=$(git tag -l | tail -1)
|
||||||
|
|
||||||
|
./version.sh "$tag_curr"
|
||||||
|
|
||||||
sed -r "s/${tag_prev}/${tag_curr}/g" -i README.md CMakeLists.txt contrib/lemonbuddy.aur/PKGBUILD contrib/lemonbuddy.aur/.SRCINFO
|
sed -r "s/${tag_prev}/${tag_curr}/g" -i README.md CMakeLists.txt contrib/lemonbuddy.aur/PKGBUILD contrib/lemonbuddy.aur/.SRCINFO
|
||||||
git add README.md CMakeLists.txt contrib/lemonbuddy.aur/PKGBUILD contrib/lemonbuddy.aur/.SRCINFO
|
git add README.md CMakeLists.txt contrib/lemonbuddy.aur/PKGBUILD contrib/lemonbuddy.aur/.SRCINFO
|
||||||
|
git add -u include/version.hpp
|
||||||
git commit -m "build: Bump version to ${tag_curr}"
|
git commit -m "build: Bump version to ${tag_curr}"
|
||||||
|
|
||||||
# Recreate the tag to include the last commit
|
# Recreate the tag to include the last commit
|
||||||
|
@ -5,7 +5,11 @@ msg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
version="$1"
|
||||||
|
|
||||||
|
[ "$version" ] || {
|
||||||
version="$(git describe --tags --dirty=-dev)"
|
version="$(git describe --tags --dirty=-dev)"
|
||||||
|
}
|
||||||
|
|
||||||
msg "Current version: ${version}"
|
msg "Current version: ${version}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user