azure-dev: [Issue] azd init fails after declining to overwrite files from template repo
Output from azd version
Run azd version
and copy and paste the output here:
azd version 0.6.0-beta.2 (commit c4a201e55a13eba77f9037b296a90e0f81b00dbe)
Describe the bug
When I decline to let azd overwrite the .gitignore
, LICENSE
, and README.md
in my current project, it failed to initialize.
To Reproduce
- Open an existing project (non-azd compatible)
- Run
azd init
on the codebase - Choose a template from the list
- Decline letting azd overwrite your files
Expected behavior
This should succeed. I’d expect that the template files are added to my project and the .gitignore
, LICENSE
and README.md
are untouched by azd.
In this case, none of these files are even core to executing the template. They’re metadata and configuration.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 19 (15 by maintainers)
It makes sense to me. I think of Cloudspaces as hosted in the cloud, but when I’m in the VM, I treat it just as any other machine. I maybe wouldn’t expect
azd
to call out that I’m running in Codespaces (logically seems reversed of how it would be).I didn’t pick the text with “application” wording, because it sounds a little vague. When I’m initializing an
azd
project/application, I don’t know if I’d expect my code beforeazd init
runs to be called an application.Yeah - that’s true that people can do ctrl/cmd+c to cancel out and a fair concern about how this scales. I agree - we shouldn’t introduce a cancel option unless we have supporting data to back doing so. I’d expect that most know that ctrl+c would get them out of the command execution.
@Austinauth @savannahostrowski I realized I had made a faulty suggestion by putting “Cancel init” as an option.
The typical way the user would “cancel” out of a CLI is to use “Ctrl + C” on their keyboard. This does work here. I’m worried if we introduce Cancellation as an option, we might be stuck in trying to implement this UI pattern everywhere, so I would maybe suggest to not introduce that options unless we need to?
Perhaps it’s clear from the logging what
azd
did, since any modifications would be logged, and the absence of that suggests the same idea. I’m going to move forward with Cancel, but just curious if you have a quick feeling one way or another.I think that looks great tbh. I agree with keeping our styles consistent as you’ve outline. Super clear.
Yeah - that makes sense. I think this would avoid us having a blocking UX. The copy might need some finessing.
cc: @Austinauth for visibility and in case he has anything to add cc: @ellismg as FYI
The intention was probably to avoid the user from cloning into an existing repository by accident.
It seems that a simple change could be to update the prompt: