Skip to content

Commit

Permalink
fix: don't await sub-process of onSuccess (#1256)
Browse files Browse the repository at this point in the history
closes #1245
  • Loading branch information
laat authored Jan 25, 2025
1 parent cd03e1e commit 314a6d7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,11 @@ export async function build(_options: Options) {
onSuccessProcess = exec(options.onSuccess, [], {
nodeOptions: { shell: true, stdio: 'inherit' },
})

await onSuccessProcess
if (
onSuccessProcess.exitCode &&
onSuccessProcess.exitCode !== 0
) {
process.exitCode = onSuccessProcess.exitCode
}
onSuccessProcess.process?.on('exit', (code) => {
if (code && code !== 0) {
process.exitCode = code
}
})
}
}
}
Expand Down

0 comments on commit 314a6d7

Please sign in to comment.