Skip to content

Commit

Permalink
Skip lifecycle hooks without a version (i.e. don't release)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Apr 30, 2022
1 parent 68e7195 commit d706484
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions lib/index.js
Expand Up @@ -93,24 +93,26 @@ const runTasks = async (opts, di) => {
process.exit(0);
}

config.setContext(parseVersion(version));
if (version) {
config.setContext(parseVersion(version));

if (config.isPromptOnlyVersion) {
config.setCI(true);
}
if (config.isPromptOnlyVersion) {
config.setCI(true);
}

for (const hook of ['beforeBump', 'bump', 'beforeRelease']) {
for (const plugin of plugins) {
const args = hook === 'bump' ? [version] : [];
await runLifeCycleHook(plugin, hook, ...args);
for (const hook of ['beforeBump', 'bump', 'beforeRelease']) {
for (const plugin of plugins) {
const args = hook === 'bump' ? [version] : [];
await runLifeCycleHook(plugin, hook, ...args);
}
}
}

plugins = [...internal, ...external];
plugins = [...internal, ...external];

for (const hook of ['release', 'afterRelease']) {
for (const plugin of plugins) {
await runLifeCycleHook(plugin, hook);
for (const hook of ['release', 'afterRelease']) {
for (const plugin of plugins) {
await runLifeCycleHook(plugin, hook);
}
}
}

Expand Down

0 comments on commit d706484

Please sign in to comment.