arco-design / arco-cli

CLI tool for Arco Design
https://arco.design/docs/material/guide
MIT License
203 stars 76 forks source link

fix: should exit with non-zero when error occur #47

Closed lianghx-319 closed 1 year ago

lianghx-319 commented 1 year ago

Types of changes

Background and context

While command line show error with zero exit code, many execution environment will success, but it should be failed.

Solution

Make all exit with non-zero if show error

How is the change tested?

Changelog

Changelog(CN) Changelog(EN) Related issues
使用正确的 exitCode 退出进程 Use the correct exitCode to exit process N/A

Checklist:

Other information

lianghx-319 commented 1 year ago

Otherwise I think using throw error instead of process.exit(1) is better. Maybe those method will reuse in the future and the process object cause unnecessary refactor. Using throw error, it can be caught wherever.

lianghx-319 commented 1 year ago

@MisterLuffy Can you have a look, when you have time for it.