#!/bin/bash

if [ -z "${npm_package_version}" ]; then
  echo "npm_package_version is required for this script! Exiting..."
  exit 1
fi

case "${npm_package_version}" in
*alpha* | *beta*)
  echo "Skipping git operations due to version type ==> ${npm_package_version}"
  exit 0
  ;;
*) ;;
esac


export release_branch="release/BCjs/${npm_package_version}"
git status
git branch "$release_branch"
git status
git add src/BarracudaClientBuildDetail.ts
git add package.json
git commit -m "Release auto-commit version ${npm_package_version}"
git push origin $release_branch:$release_branch


yarn tag ls
