#!/usr/bin/env bash

# Quit on the first error
set -e

if [ -z "$1" ]
  then
    echo "You must supply a bump type argument of major|minor|patch"
    exit 1;
fi

git pull origin master

npm run build

if [ -z "$(git status --porcelain)" ]; then 
  echo "Working directory clean"
else 
  git add .
  git commit -m "Update built code"
fi




npm version $1
git push origin master --tags

npm publish