Skip to content

Commit

Permalink
feat: don't release a new version if plugin returned null (#1004)
Browse files Browse the repository at this point in the history
  • Loading branch information
cakeinpanic committed May 2, 2023
1 parent 68cb03e commit 46fc8fa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/index.js
Expand Up @@ -77,16 +77,17 @@ const runTasks = async (opts, di) => {
const action = config.isIncrement ? 'release' : 'update';
const suffix = version && config.isIncrement ? `${latestVersion}...${version}` : `currently at ${latestVersion}`;

if (!config.isReleaseVersion && !config.isChangelog) {
log.obtrusive(`🚀 Let's ${action} ${name} (${suffix})`);

log.preview({ title: 'changelog', text: changelog });
}

if (config.isIncrement) {
version = version || (await reduceUntil(plugins, plugin => plugin.getIncrementedVersion(incrementBase)));
}

if (!version) {
log.obtrusive(`No new version to release`);
} else if (!config.isReleaseVersion && !config.isChangelog) {
log.obtrusive(`🚀 Let's ${action} ${name} (${suffix})`);
log.preview({ title: 'changelog', text: changelog });
}

if (config.isReleaseVersion) {
console.log(version);
process.exit(0);
Expand Down

0 comments on commit 46fc8fa

Please sign in to comment.