#!/bin/bashset-eif["$TRAVIS_BRANCH"!="release"];thenecho"Skipping release because this is not the 'release' branch"exit 0fi# Travis executes this script from the repository root, so at the same level than package.jsonVERSION=$(node -p-e"require('./package.json').version")# Make sure that the associated tag doesn't already existGITTAG=$(git ls-remote origin refs/tags/v$VERSION)if["$GITTAG"!=""];thenecho"Tag for package.json version already exists, aborting release"exit 1figit remote add auth-origin https://$GITHUB_AUTH_TOKEN@github.com/$TRAVIS_REPO_SLUG.gitgit config --global user.email "$GITHUB_AUTH_EMAIL"git config --global user.name "Chart.js"git checkout --detach--quietgit add -f dist/*.js bower.jsongit commit -m"Release $VERSION"git tag -a"v$VERSION"-m"Version $VERSION"git push -q auth-origin refs/tags/v$VERSION 2>/dev/nullgit remote rm auth-origingit checkout -f @{-1}