Skip to content

Commit

Permalink
fix: only report error for install deps step if exit code is non-zero (
Browse files Browse the repository at this point in the history
…#249)

Fixes #239
  • Loading branch information
chrispcampbell authored Sep 27, 2022
1 parent 74d71e9 commit dc14b1c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/create/src/step-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ export async function chooseInstallDeps(projDir: string, args: Arguments, pkgMan
installSpinner.text = `${installingPackagesMsg}\n${bold(`[${pkgManager}]`)} ${data}`
})
installExec.on('error', error => reject(error))
installExec.on('exit', code => reject(`Install failed (code=${code})`))
installExec.on('close', () => resolve())
installExec.on('close', code => {
if (code !== 0) {
reject(`Install failed (code=${code})`)
} else {
resolve()
}
})
})
installSpinner.text = green('Packages installed!')
installSpinner.succeed()
Expand Down

0 comments on commit dc14b1c

Please sign in to comment.