Skip to content

Commit

Permalink
Merge pull request #1976 from spentacular/git-tag-dry-run-version
Browse files Browse the repository at this point in the history
rearrange to allow dryrun to leverage prefixed tag
  • Loading branch information
hipstersmoothie committed May 8, 2021
2 parents 987c976 + dc5bf05 commit a7cfda2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/git-tag/src/index.ts
Expand Up @@ -44,23 +44,23 @@ 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;
}

const prefixedTag = auto.prefixRelease(newTag);

if (dryRun) {
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",
Expand Down

0 comments on commit a7cfda2

Please sign in to comment.