#!/bin/bash -xe

#if [ -n "$(git status --porcelain)" ]; then
#  echo "The git working directory is not clean. Exiting."
#  exit 1
#fi

unset METEOR_ENV
npm test
version=$(jq -r .version < package.json)
tag_name="v${version}"
echo "Publishing $tag_name"
npm publish "$@"
git tag $tag_name
git push origin $tag_name
