Skip to content
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

Merged
merged 7 commits into from
Jul 23, 2024
Merged

Feat/init overwrite #1477

merged 7 commits into from
Jul 23, 2024

Conversation

BlaineHeffron
Copy link
Contributor

@BlaineHeffron BlaineHeffron commented Jul 23, 2024

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

@BlaineHeffron
Copy link
Contributor Author

logic cleaned up

Copy link
Member

@willemneal willemneal left a 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.

BlaineHeffron and others added 3 commits July 23, 2024 13:06
simplify appended check

Co-authored-by: Willem Wyndham <[email protected]>
simplified appended check

Co-authored-by: Willem Wyndham <[email protected]>
@willemneal willemneal merged commit 31cdfdd into stellar:main Jul 23, 2024
23 checks passed
@willemneal willemneal deleted the feat/init-overwrite branch July 23, 2024 18:44
@@ -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.
Copy link
Member

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.")]
Copy link
Member

@leighmcculloch leighmcculloch Jul 23, 2024

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.

Suggested change
#[arg(short, long, long_help = "Overwrite all existing files.")]
#[arg(short, long, long_help = "Overwrite any existing files.")]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add --overwrite to stellar contract init
3 participants