From 70363edc7476a800d817ec67755d7f3d828bce32 Mon Sep 17 00:00:00 2001 From: pvincent Date: Tue, 23 Aug 2022 21:57:08 +0400 Subject: [PATCH] semver package.json --- tools/semver_git_tag | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/semver_git_tag b/tools/semver_git_tag index 77b371f..fe899b2 100755 --- a/tools/semver_git_tag +++ b/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 ..."