-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
9ee56f0
commit d3bf2f0
Showing
2 changed files
with
21 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
REF=$1 | ||
|
||
versionFile=$(cat VERSION | tr -d '[:space:]') | ||
if [[ $REF == refs/tags/* ]]; then | ||
# check if versionFile equals the tag. | ||
if [[ $versionFile != "${REF#refs/tags/}" ]]; then | ||
echo "Version in VERSION file does not match the tag" | ||
exit 1 | ||
fi | ||
echo "Version correctly matches tag" | ||
else | ||
# if this isnt a release, add the commit hash to the end of the version | ||
v=$(git rev-parse --short HEAD) | ||
updatedVersion = "${versionFile}+${v}" | ||
echo "Updated version to '${updatedVersion}'" | ||
echo -n $updatedVersion > VERSION | ||
fi |