This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue #32 : support for semver semantics
A new flag (-s) now prints a semver version number and exits. Script version.sh has been updated so that go:generate sets a new constant in version.go to the most recent semver value. For now, semantic version should be incremented manually by creating git tags.
- Loading branch information
Seth Hoenig
committed
Jan 8, 2018
1 parent
ebb6c40
commit 44d8bdb
Showing
4 changed files
with
123 additions
and
89 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
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
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
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 |
---|---|---|
@@ -1,7 +1,18 @@ | ||
#!/bin/bash | ||
|
||
hash=$(git rev-parse HEAD) | ||
|
||
sed -i s/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/$hash/ version.go | ||
|
||
set -euo pipefail | ||
|
||
case ${1} in | ||
version) | ||
hash=$(git rev-parse HEAD) | ||
sed -i s/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/${hash}/ version.go | ||
;; | ||
semver) | ||
latest=$(git tag --sort=version:refname | tail -n 1) | ||
sed -i s/x.x.x/${latest}/ version.go | ||
;; | ||
*) | ||
echo "unknown flag: ${1}" | ||
exit 1 | ||
;; | ||
esac |