Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benallfree committed Apr 23, 2024
1 parent ebcb2a3 commit e5e1208
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 12 additions & 6 deletions plop/commands/util/startVerdaccio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ export const startVerdaccio = async () => {
resolve(0)
return
}
proc!.on('exit', (code) => {
proc = undefined
resolve(code || 0)
})
console.log(`Stopping verdaccio...`)
proc!.kill()
if (proc?.killed) {
console.log(`proc already killed`)
resolve(proc.exitCode || 0)
} else {
console.log(`Stopping verdaccio...`)
proc!.on('exit', (code) => {
proc = undefined
console.log(`proc exited`)
resolve(code || 0)
})
proc!.kill()
}
})
}

Expand Down
1 change: 1 addition & 0 deletions plop/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ async function main() {
})
}
main().catch((e) => {
console.error(e)
gracefulExit(1)
})

0 comments on commit e5e1208

Please sign in to comment.