#!/bin/bash

MAIN_BRANCH="main"
DEVELOP_BRANCH="develop"

if [ -z "$1" ]
then
  echo "Must specify the release type: major, minor, patch"
  exit;
fi

git checkout $DEVELOP_BRANCH
npm version $1
git push origin $DEVELOP_BRANCH

git checkout $MAIN_BRANCH
git pull . $DEVELOP_BRANCH
git push origin $MAIN_BRANCH

git checkout $DEVELOP_BRANCH
