-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <version>" | ||
exit 1 | ||
fi | ||
|
||
# check if git is clean | ||
if ! git diff-index --quiet HEAD --; then | ||
echo "Please commit your changes before bumping the version" | ||
exit 1 | ||
fi | ||
|
||
echo "Last version: $(git describe --abbrev=0 --tags)" | ||
echo "New version: $1" | ||
|
||
read -p "This command will replace version strings and create a commit. Proceed? (y/n) " -n 1 -r; echo | ||
[ "$REPLY" != "y" ] && exit 1 | ||
|
||
gsed -i -E "s/(Version: +)\".+\"/\1\"$1\"/" pro.go | ||
git add pro.go | ||
echo pro.go Done | ||
|
||
git commit -m "Bump version to $1" | ||
|
||
read -p "Do you want to tag the commit? (y/n) " -n 1 -r; echo | ||
if [ "$REPLY" = "y" ]; then | ||
git tag "$1" | ||
fi | ||
|
||
git show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters