#!/usr/bin/env bash # Slightly modified version of xyz that publishes from the build directory, # rather than the root. set -e usage=" Usage: xyz [options] Publish a new version of the npm package in the current working directory. This involves updating the version number in package.json, committing this change (along with any staged changes), tagging the commit, pushing to the remote git repository, and finally publishing to the public npm registry. Options: -b --branch Specify the branch from which new versions must be published. xyz aborts if run from any other branch to prevent accidental publication of feature branches. 'master' is assumed if this option is omitted. -i --increment Specify the level of the current version number to increment. Valid levels: 'major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', and 'prerelease'. 'patch' is assumed if this option is omitted. -m --message