Skip to content
Permalink
1dd0df1fa1
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 30 lines (24 sloc) 691 Bytes
#!/bin/bash
usage() { echo "Usage: $0 -p [major | minor | patch]" 1>&2; exit 1; }
while getopts "p:" o; do
case "${o}" in
p)
patch_level=${OPTARG}
(( patch_level == 'major' || patch_level == 'minor' || patch_level == 'patch'))
;;
*)
usage
;;
esac
done
echo "$patch_level"
if [[ -z "${patch_level}" ]]; then
usage
fi
new_version=$(npm version "${patch_level}" --no-git-tag-version)
git checkout -b "${new_version}"-release-notes
git add package.json package-lock.json
git commit -m "${new_version}"
echo "Branch prepared for ${new_version}"
echo "To prepare a release, run:"
echo " gh release create ${new_version} --draft --generate-notes"