Skip to content

Add --yes flag to recipes:install command to overwrite all files without asking #963

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

Merged
merged 1 commit into from
May 20, 2025

Conversation

shyim
Copy link
Contributor

@shyim shyim commented Jan 5, 2023

When I run recipes:install --reset --force -n no files are overwritten, as the default as been set to false.

There is currently also no way to accept that, so I changed it back to true

@shyim shyim changed the title Overwrite all files when in non interactive mode Overwrite all files when not in non interactive mode Jan 5, 2023
@stof
Copy link
Member

stof commented Apr 8, 2025

Note that this default should impact only files for which git cannot give us the modified state or untracked files. Existing files created by recipes are supposed to be tracked files. What is your workflow in which no files are being overwritten ?

@shyim shyim force-pushed the patch-1 branch 2 times, most recently from 93736e2 to a609fb9 Compare April 10, 2025 07:02
@shyim
Copy link
Contributor Author

shyim commented Apr 10, 2025

We have many customers that don't use Git (yes it's bad). Therefore they can't use the recipes:update command, so we tell them to use recpies:install --reset --force -n and diff them on their own (or create only new yaml files, don't touch existing ones).

As no file is tracked, flex asks for like 30 files this question, and for non interactive sessions, it did no changes as the default was false

@nicolas-grekas nicolas-grekas changed the base branch from 1.x to 2.x May 20, 2025 12:38
@nicolas-grekas
Copy link
Member

Did you try using the yes command instead?

@nicolas-grekas
Copy link
Member

I'd rather handle this with a new command line argument instead, so that the default is safe. eg -y to swap the defaults.

Please rebase to target 2.x also (and revert the unrelated changes while doing so)

@shyim
Copy link
Contributor Author

shyim commented May 20, 2025

I will add an flag -y, is fine for me :)

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nitpicking and GTM

@nicolas-grekas
Copy link
Member

  1. Symfony\Flex\Tests\OptionsTest::testShouldWrite
    Failed asserting that true is false.

test case failing though

@shyim
Copy link
Contributor Author

shyim commented May 20, 2025

is now finally green :)

@nicolas-grekas nicolas-grekas changed the title Overwrite all files when not in non interactive mode Add --yes flag to recipes:install command to overwrite all files without asking May 20, 2025
@nicolas-grekas
Copy link
Member

Thank you @shyim.

@nicolas-grekas nicolas-grekas merged commit 5f92875 into symfony:2.x May 20, 2025
7 checks passed
@shyim shyim deleted the patch-1 branch May 20, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants