Skip to content

Commit

Permalink
fix: avoid multiple verifyConditions invocation
Browse files Browse the repository at this point in the history
closes #414
  • Loading branch information
antongolub committed Oct 27, 2021
1 parent 7c55636 commit a8981db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ let prepared;
const npmrc = tempy.file({name: '.npmrc'});

async function verifyConditions(pluginConfig, context) {
if (verified) {
return;
}

// If the npm publish plugin is used and has `npmPublish`, `tarballDir` or `pkgRoot` configured, validate them now in order to prevent any release if the configuration is wrong
if (context.options.publish) {
const publishPlugin =
Expand All @@ -39,7 +43,7 @@ async function verifyConditions(pluginConfig, context) {
errors.push(...error);
}

if (errors.length > 0) {
if (errors.length > 0 && !verified) {
throw new AggregateError(errors);
}

Expand Down

0 comments on commit a8981db

Please sign in to comment.