Snippets

Ben Buchanan shrinkwrap extract from release script

Updated by Ben Buchanan

File shrinkwrap.sh Modified

  • Ignore whitespace
  • Hide word diff
 #!/bin/bash
-<<USAGE
+<<NOTES
 
 NB - this code has not been tested out of context
 
 * starts on updated master branch
 * npm install has already been run
 * test suite has already been run
-USAGE
+NOTES
 
 VERSION=$1
 
Created by Ben Buchanan

File shrinkwrap.sh Added

  • Ignore whitespace
  • Hide word diff
+#!/bin/bash
+<<USAGE
+
+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
+USAGE
+
+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"
HTTPS SSH

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