2015-04-24 23:24:10 +00:00
|
|
|
VERSION="$1"
|
|
|
|
PACKAGE_PATH="$2"
|
|
|
|
CWD="${PWD}"
|
2015-02-10 19:41:24 +00:00
|
|
|
|
|
|
|
if [ ! -d .git ]; then
|
|
|
|
echo "$CWD is not a git repository" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-04-24 23:24:10 +00:00
|
|
|
if [ ! -f "$PACKAGE_PATH" ]; then
|
2015-02-10 19:41:24 +00:00
|
|
|
echo "Could not find package.json" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Commit the package.json file
|
|
|
|
git add $PACKAGE_PATH
|
|
|
|
git commit -m "Publish version $VERSION"
|
|
|
|
|
|
|
|
# Create a new Git tag for the version being published.
|
|
|
|
git tag $VERSION
|
|
|
|
|
|
|
|
# Pushe the tag and current branch up to origin.
|
|
|
|
git push origin --tags
|