Skip to content

Commit

Permalink
rearrange to allow dryrun to leverage prefixed tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Hamm committed May 5, 2021
1 parent 987c976 commit 29df201
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 && 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",
Expand Down

0 comments on commit 29df201

Please sign in to comment.