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

Overwrite all files when not in non interactive mode #963

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from

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
@@ -68,7 +68,7 @@ public function shouldWriteFile(string $file, bool $overwrite): bool
exec('git status --short --ignored --untracked-files=all -- '.ProcessExecutor::escape($file).' 2>&1', $output, $status);

if (0 !== $status) {
return $this->io && $this->io->askConfirmation(sprintf('Cannot determine the state of the "%s" file, overwrite anyway? [y/N] ', $file), false);
return $this->io && $this->io->askConfirmation(sprintf('Cannot determine the state of the "%s" file, overwrite anyway? [y/N] ', $file));
Copy link
Member

Choose a reason for hiding this comment

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

you should change which of the y and n is a capital letter to reflect the default, so that users will know what will happen if they press Enter without writing any letter.

@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 ?

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.

3 participants