Last active
May 26, 2021 10:41
-
-
Save ip413/b4534b02620111d18ec4b645c847e84e to your computer and use it in GitHub Desktop.
App verison number generator from date and git commit hash
This file contains hidden or 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
<html> | |
<head> | |
</head> | |
<span> | |
__APP_VERSION__ | |
</span> | |
</html> |
This file contains hidden or 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
#!/bin/bash | |
# Generates app version string in form: "2017-05-08--10-24-35--b306d134" | |
# | |
# String format: | |
# - 2017-05-08 is a date (YYYY-MM-DD), | |
# - 10.24 is hour and minutes (HH-MM-SS) and | |
# - b306d134 is a last commit hash from local repo. | |
# Usage: | |
# sed -i "s/__APP_VERSION__/$(./set_app_version.sh)/" index.html | |
echo $(date +'%Y-%m-%d--%H-%M-%S--')$(git log --format="%H" -n 1 | cut -c 1-7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment