-
Notifications
You must be signed in to change notification settings - Fork 983
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
Add flag to override prompt for existing dir #1986
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added --force flag to build subcommand.
I think #1985 covers your usecase as it won't delete the folder? |
On 22/09/12 10:07AM, Vincent Prouillet wrote:
I think #1985 covers your usecase as it won't delete the folder?
Except it doesn't, because what PR #1558 introduced is a prompt for when
the output dir already exists, which is bad for non-interactive cases
(my use-case). PR #1985 doesn't cover this, since, AFAICT, it doesn't
override the prompt, which my PR does.
…--
Yaroslav de la Peña Smirnov
|
Keats
requested changes
Sep 14, 2022
src/cmd/build.rs
Outdated
include_drafts: bool, | ||
) -> Result<()> { | ||
let mut site = Site::new(root_dir, config_file)?; | ||
if let Some(output_dir) = output_dir { | ||
// Check whether output directory exists or not | ||
// This way we don't replace already existing files. | ||
if output_dir.exists() { | ||
if !force && output_dir.exists() { | ||
console::warn(&format!("The directory '{}' already exists. Building to this directory will delete files contained within this directory.", output_dir.display())); | ||
|
||
// Prompt the user to ask whether they want to continue. |
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.
Let's remove the tokio timeout + question if there is a flag option though. It should just fail if the folder exists and --force is not passed.
On 22/09/14 04:12AM, Vincent Prouillet wrote:
@Keats requested changes on this pull request.
Let's remove the tokio timeout + question if there is a flag option
though. It should just fail if the folder exists and --force is not
passed.
Sure, I've committed the changes.
…--
Yaroslav de la Peña Smirnov
|
Keats
approved these changes
Sep 19, 2022
Thanks! |
Keats
pushed a commit
that referenced
this pull request
Feb 16, 2023
* Add flag to override prompt for existing dir Added --force flag to build subcommand. * Remove unnecessary 'force' check * Remove prompt to overwrite directory on build cmd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added --force flag to build subcommand. This restores use-cases that PR #1558
broke, without breaking current default behaviour.
IMPORTANT: Please do not create a Pull Request adding a new feature without
discussing it first.
The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the
feature requests section.
Sanity check:
Pull Requests for the same
update/change?
Code changes (Delete or ignore this section for documentation changes)
next
branch?If the change is a new feature or adding to/changing an existing one: