-
Notifications
You must be signed in to change notification settings - Fork 110
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
7 changed files
with
28 additions
and
14 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
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,20 @@ | ||
#!/bin/bash | ||
|
||
# --exact-match will ensure the tag is only returned if our commit is a tag | ||
version=$(git describe --exact-match --tags 2>/dev/null) | ||
if [[ $? -eq 0 ]]; then | ||
echo $version | ||
exit | ||
fi | ||
|
||
# use current timestamp for dirty builds | ||
if ! git diff --no-ext-diff --quiet --exit-code ; then | ||
current_timestamp=$(date +"%s") | ||
echo "v0.0.${current_timestamp}-dirty" | ||
exit | ||
fi | ||
|
||
# otherwise assume we are on a develop build and use commit timestamp for version | ||
commit_timestamp=$(git show --no-patch --format=%at) | ||
|
||
echo "v0.0.${commit_timestamp}-develop" |