-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Added prompt for when zola build output-dir mentions an existing directory. #1558
Conversation
Added `ask_bool` prompt for `--output-dir` for when the output directory targeted already exists in the file system. [Issue: #1378]
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.
Seems ok but I'll wait to see if there is a need for a 0.14.1 before merging that.
There is now a 10s prompt timeout using tokio's timeout. |
Thanks! |
So I am back here to complain about another change that breaks my use-case :) I want to propose a flag that will force the build without prompting. My rationale is the following: I have a git hook that builds my site on every push to master and, although I could edit the script to delete the folder prior to building, I don't want to that, because I need to preserve the mode bits and ownership of the directory. What do you say @Keats ? Actually I already have a patch, so I'll create a PR in a little bit ;) (Edited to add some clarity into my words) |
…ctory. (getzola#1558) * Next version * Added ask prompt for output-dir flag Added `ask_bool` prompt for `--output-dir` for when the output directory targeted already exists in the file system. [Issue: getzola#1378] * Updated the documentation for getzola#1378 * Added missing "sure" in prompt text * Added timeout to prompt + dirname * Fixed complication errors Co-authored-by: Vincent Prouillet <[email protected]>
I went about implementing this. It wasn't too hard, especially since
ask_bool
andPath::exists
exist.There is one concern I ran into after implementing this. It may need to be discussed still. Is it okay to require CI's to first delete the folder in question? This may break CI's and automated scripts, and therefore it may be interesting to add to the 0.15 release.
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:
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:
Added
ask_bool
prompt for--output-dir
for when the output directory targeted already exists in the file system. Updated the documentation to match this behaviour.Fixes #1378.