You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new application on a path that exists and is non-empty.
Choose Abort installation at the prompt asking for overwrite confirmation. Alternatively, proceed with any of the other two options, and choose No at the next prompt.
Check the exit code - 0.
Additional information
I'd be happy to raise a PR 🙌
The text was updated successfully, but these errors were encountered:
Does choosing to exit the CLI because the folder already exists count as an "error"? It's an intentional choice by the user. I'm not super familiar with exit codes so need to research this one.
Does choosing to exit the CLI because the folder already exists count as an "error"? It's an intentional choice by the user.
I understand your point. But doesn't it count as a failed attempt while scaffolding a new project? Currently, it is signified by the spinner status set to fail.
Consider a scenario in which the CLI is consumed in a CI environment; let's assume the existence of conflicting files isn't intended, and No is supplied if the prompt shows up, asking for the confirmation to overwrite. In this case, the job would succeed with the exit code being 0. However, we'd want the job would fail since the scaffolding didn't happen.
create-vue CLI handles it this way.
create-react-app and create-next-app returns with an exit code of 1 on encountering conflicting files. They don't handle directory cleanup.
Provide environment information
create-t3-app
v6.11.6. Not including the environment information since this is directly related to the CLI.Describe the bug
Aborting installation while scaffolding in a non-empty directory results in a
0
exit code. An instance of failure should ideally result in a non-zero exit code. Ref: lirantal/nodejs-cli-apps-best-practices#64-proper-use-of-exit-codes.To reproduce
Abort installation
at the prompt asking for overwrite confirmation. Alternatively, proceed with any of the other two options, and chooseNo
at the next prompt.0
.Additional information
I'd be happy to raise a PR 🙌
The text was updated successfully, but these errors were encountered: