From 29df201572eec8d535e391e3515dc69612e084c1 Mon Sep 17 00:00:00 2001 From: Spencer Hamm Date: Wed, 5 May 2021 13:44:34 -0500 Subject: [PATCH 1/2] rearrange to allow dryrun to leverage prefixed tag --- plugins/git-tag/src/index.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/git-tag/src/index.ts b/plugins/git-tag/src/index.ts index 54d87ce7c..d523460a2 100644 --- a/plugins/git-tag/src/index.ts +++ b/plugins/git-tag/src/index.ts @@ -44,16 +44,6 @@ export default class GitTagPlugin implements IPlugin { const lastTag = await getTag(); const newTag = inc(lastTag, bump as ReleaseType); - if (dryRun && newTag) { - if (quiet) { - console.log(newTag); - } else { - auto.logger.log.info(`Would have published: ${newTag}`); - } - - return; - } - if (!newTag) { auto.logger.log.info("No release found, doing nothing"); return; @@ -61,6 +51,16 @@ export default class GitTagPlugin implements IPlugin { const prefixedTag = auto.prefixRelease(newTag); + if (dryRun && prefixedTag) { + if (quiet) { + console.log(prefixedTag); + } else { + auto.logger.log.info(`Would have published: ${prefixedTag}`); + } + + return; + } + auto.logger.log.info(`Tagging new tag: ${lastTag} => ${prefixedTag}`); await execPromise("git", [ "tag", From dc5bf050b02c119a332b9b830eda432cb9cea77a Mon Sep 17 00:00:00 2001 From: Spencer Hamm Date: Wed, 5 May 2021 14:22:40 -0500 Subject: [PATCH 2/2] remove useless double check for newTag --- plugins/git-tag/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-tag/src/index.ts b/plugins/git-tag/src/index.ts index d523460a2..63afc9af6 100644 --- a/plugins/git-tag/src/index.ts +++ b/plugins/git-tag/src/index.ts @@ -51,7 +51,7 @@ export default class GitTagPlugin implements IPlugin { const prefixedTag = auto.prefixRelease(newTag); - if (dryRun && prefixedTag) { + if (dryRun) { if (quiet) { console.log(prefixedTag); } else {