Skip to content

Commit

Permalink
fix: 🐛 merge issue comment
Browse files Browse the repository at this point in the history
close related issue

fix #1
  • Loading branch information
bubkoo committed Nov 3, 2020
1 parent 3e101b9 commit 7cf29fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 49 deletions.
9 changes: 0 additions & 9 deletions packages/a/CHANGELOG.md

This file was deleted.

9 changes: 0 additions & 9 deletions packages/b/CHANGELOG.md

This file was deleted.

11 changes: 0 additions & 11 deletions packages/c/CHANGELOG.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/d/CHANGELOG.md

This file was deleted.

31 changes: 12 additions & 19 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export namespace Plugin {
) {
const { cwd } = multiContext
const { emit, todo, waitFor, waitForAll, getLucky } = synchronizer
let successExectued = false

return function create(pkg: Package) {
const { deps, plugins, dir, path, name } = pkg
Expand Down Expand Up @@ -254,39 +255,31 @@ export namespace Plugin {
return res.length ? res[0] : {}
}

let successCount = 0
const releases: SemanticRelease.Release[] = []

const success = async (
pluginOptions: any,
context: SemanticRelease.Context,
) => {
pkg.published = true
await waitForAll('published', (p) => p.nextType != null)
const packages = todo().filter((p) => p.nextType != null)
successCount += 1

console.log(
'=====================================',
successCount,
'###',
packages.length,
)

if (successCount < packages.length) {
pluginOptions.successComment = false
releases.push(...(context as any).releases)
} else {
console.log('=====================================', successExectued)

if (!successExectued) {
successExectued = true
const packages = todo().filter((p) => p.nextType != null)
const releases: SemanticRelease.Release[] = []
packages.forEach((p) => {
if (p.result) {
releases.push(...p.result.releases)
}
})
const ctx = context as any
ctx.releases = releases
pluginOptions.successComment = getSuccessComment()
await plugins.success(context)
}

// console.log(plugins.success)
// const res = await plugins.success(pluginOptions, context)
debug('succeed: %s', pkg.name)
// return res
}

const plugin: { [key: string]: any } = {
Expand Down

0 comments on commit 7cf29fa

Please sign in to comment.