#!/bin/sh

set -e

if [ "$1" != "dev" ] && [ "$1" != "prod" ]; then
  echo "The first argument must be 'dev' or 'prod'."
  exit
fi

set -x

node ./bin/prepublish.js --"$1"
npm publish --access public
node ./bin/postpublish.js --"$1"