-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/init overwrite #1477
Feat/init overwrite #1477
Conversation
logic cleaned up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more small nit.
simplify appended check Co-authored-by: Willem Wyndham <[email protected]>
simplified appended check Co-authored-by: Willem Wyndham <[email protected]>
@@ -424,6 +424,7 @@ Initialize a Soroban project with an example contract | |||
* `-f`, `--frontend-template <FRONTEND_TEMPLATE>` — An optional flag to pass in a url for a frontend template repository. | |||
|
|||
Default value: `` | |||
* `-o`, `--overwrite` — Overwrite all existing files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should add the short option -o
, opened a PR removing it and why is mentioned there:
@@ -47,6 +47,9 @@ pub struct Cmd { | |||
long_help = "An optional flag to pass in a url for a frontend template repository." | |||
)] | |||
pub frontend_template: String, | |||
|
|||
#[arg(short, long, long_help = "Overwrite all existing files.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the intent that the command will overwrite the entire directory such as remove the directory contents first, then start writing? Or is the intent that the command will overwrite individual files also included in the template and leave any additional files as they are?
The term 'all' may introduce some ambiguity to the scope of what is removed, and given the destructive nature of this command we should try and limit the ambiguity.
The term 'any' may limit the ambiguity, although not perfectly.
#[arg(short, long, long_help = "Overwrite all existing files.")] | |
#[arg(short, long, long_help = "Overwrite any existing files.")] |
What
Adds an --overwrite option to
contract init
Why
Useful if you don't want to delete the files yourself - requested here #1425
Close #1425
Known limitations
N/A