Snippets

Ben Buchanan shrinkwrap extract from release script

Created by Ben Buchanan last modified Ben Buchanan
#!/bin/bash
<<NOTES

NB - this code has not been tested out of context

USAGE
./release.sh <version>
eg.
./release.sh 1.2.3

This was extracted from a much larger/longer release script.
The real script has some confirmation prompts; and a few
things are handled before this part runs:
* starts on updated master branch
* npm install has already been run
* test suite has already been run
NOTES

VERSION=$1

echo "Create working branch for $VERSION"
git checkout -b "$VERSION"

echo "Create NPM shrinkwrap file"
npm prune
npm shrinkwrap --dev
git add npm-shrinkwrap.json -f

echo "Tag and push release"
git tag -a "$VERSION" -m "Version: $VERSION"
git push origin tags/"$VERSION"

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.