From ccdefb756cfa26f89d33c698e27b9a0eda97fe74 Mon Sep 17 00:00:00 2001 From: binsee <5285894+binsee@users.noreply.github.com> Date: Sun, 10 Apr 2022 02:28:55 +0800 Subject: [PATCH] remove tag for git (#24) * feat: no git tag version Fixes: #21 * fix: :bug: --no-git-tag-version does not commit see https://github.com/npm/cli/issues/3710 * 0.7.4 --- bin/pre-push.ts | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/pre-push.ts b/bin/pre-push.ts index 3ae48d0..54533ba 100755 --- a/bin/pre-push.ts +++ b/bin/pre-push.ts @@ -69,6 +69,9 @@ shell.rm('-f', 'package-lock.json') shell.exec('npm version patch --no-package-lock').code === 0 || process.exit(1) process.env[INNER_PRE_HOOK] = '1' +const version = shell.exec('git log --pretty=format:"%s" HEAD^0 -1', { silent : true }).stdout +shell.exec(`git tag -d v${version}`).code === 0 || process.exit(1) + const refMaps = refs.map(ref => ref.remoteBranch ? ref.localBranch + ':' + ref.remoteBranch : '') const cmd = ['git push', remoteName, ...refMaps].join(' ') shell.exec(cmd).code === 0 || process.exit(1) diff --git a/package.json b/package.json index 453ac6c..b338afc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chatie/git-scripts", - "version": "0.7.3", + "version": "0.7.4", "description": "Git Hooks Integration for Chatie Projects", "directories": { "doc": "docs",