Last active
October 8, 2017 20:33
-
-
Save ryasmi/20591ef8f1f04fabfe649e56901f68e7 to your computer and use it in GitHub Desktop.
A shell script to generate the Moodle plugin version file using git tags and Travis.
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
release=$(echo "${TRAVIS_TAG//v}") | |
requires=$REQUIRED_MOODLE_VERSION | |
today=$(date +"%Y-%m-%d") | |
todaysReleases=$(git log --tags --simplify-by-decoration --pretty="format:%ai %d" | sort -r | grep "$today" | wc -l | tr -d '[:space:]') | |
versionPrefix=$(date +"%Y%m%d") | |
versionSuffix=$(printf %02d $todaysReleases) | |
version="$versionPrefix$versionSuffix" | |
template=$(cat template) | |
eval "echo \"$template\"" > version.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment