tensorchord/envd

feat: Have a good interaction when executing `envd init`

rrain7 opened this issue · 3 comments

rrain7 commented

Describe the feature

When creating a project and initializing it with envd init, the user forgets that it has been initialized before and the file build.envd already exists. At this time the user executes envd init, envd will first ask the user to select the programming language and throw an error after the selection:
error: build.envd already exists, use --force to overwrite it

So I think it makes more sense to first check if build.envd exists, instead of first letting the user choose the programming language. Then the user is prompted to use --force to override the original, or to run envd up to start.

Why do you need this feature?

In my humble opinion, when build.envd exists at the root of the project, it doesn't make sense to first select a programming language and then throw an error, it's a better interaction to first check if build.envd exists and remind the user if the previous one is overwritten with --force

Additional context

for example, when I exec envd init in the demo, but I forgot that I had initialized it with envd. So I had to re-execute the command I wanted to operate. In this process, the operation of selecting the programming language is meaningless.
image

rrain7 commented

If it does make sense, I'd be interested in optimizing this prompt

If it does make sense, I'd be interested in optimizing this prompt

LGTM, thanks.

/assign @rrain7