Skip to content

Commit

Permalink
fix: add publish failure detection
Browse files Browse the repository at this point in the history
  • Loading branch information
geotrev committed Feb 22, 2022
1 parent e4c24e3 commit 3e2ddb0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .bin/publish-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export async function publishPackage(args, entry) {

if (failures) {
reporter.fail(`Something went wrong releasing ${entry.name}`)
return false
} else {
pkgReporter.succeed("Publish successful")
return true
}
}
7 changes: 6 additions & 1 deletion .bin/version-and-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ export async function versionAndPublish(args, config) {
})

const versioned = await bumpVersion(args, config, entry, newVersion)
let published

if (versioned) {
await publishPackage(args, entry)
published = await publishPackage(args, entry)
} else {
failures = true
}

if (!published) {
failures = true
}
}

if (!failures) {
Expand Down

0 comments on commit 3e2ddb0

Please sign in to comment.