Skip to content

Instantly share code, notes, and snippets.

@dmlap
Created December 3, 2013 23:11
Show Gist options
  • Save dmlap/7779392 to your computer and use it in GitHub Desktop.
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.
#! /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