Created
December 3, 2013 23:11
-
-
Save dmlap/7779392 to your computer and use it in GitHub Desktop.
A quick versioning script for video.js that un-ignores the dist directory, commits a release, and then cleans up the dist directory afterwards.
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
#! /bin/sh | |
# stop immediately if any errors are encountered | |
set -o errexit | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: version.sh [<newversion> | major | minor | patch | build]" | |
exit 1 | |
fi | |
# build everything | |
grunt | |
# temporarily add the dist/ directory to source control | |
sed -i.dev 's$dist/\*$$' .gitignore | |
git add .gitignore | |
git add dist | |
# committing the new version | |
git commit -m "Adding distribution files for release" | |
npm version $1 | |
# clean up | |
git rm -r dist | |
mv .gitignore.dev .gitignore | |
git add .gitignore | |
git commit -m "Cleaning up distribution files after release" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment