Browse Source

semver package.json

master
pvincent 2 years ago
parent
commit
70363edc74
  1. 9
      tools/semver_git_tag

9
tools/semver_git_tag

@ -33,6 +33,8 @@ function setCommand() {
############# main
set -euo pipefail # EXITS when any error occurs
# check git covered
REPOSITORY=$(git config --get remote.origin.url)
if [[ "$?" -ne 0 ]]; then
@ -133,13 +135,10 @@ if [[ -f "${GIT_ROOT_FOLDER}/package.json" ]]; then
exit 5
fi
tmp=$(mktemp)
yq ".version = $TAG" "${GIT_ROOT_FOLDER}/package.json" >"$tmp" && mv "$tmp" "${GIT_ROOT_FOLDER}/package.json"
yq -i ".version=\"$TAG\"" "${GIT_ROOT_FOLDER}/package.json"
git add ${GIT_ROOT_FOLDER}/package.json
fi
set -euo pipefail # EXITS when any error occurs
echo $TAG >${GIT_ROOT_FOLDER}/.semver_git_tag
git add ${GIT_ROOT_FOLDER}/.semver_git_tag
echo "tagging as $TAG ..."

Loading…
Cancel
Save