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

Added prompt for when zola build output-dir mentions an existing directory. #1558

Merged
merged 7 commits into from
Sep 4, 2021
Merged

Added prompt for when zola build output-dir mentions an existing directory. #1558

merged 7 commits into from
Sep 4, 2021

Conversation

coastalwhite
Copy link
Contributor

@coastalwhite coastalwhite commented Jul 21, 2021

I went about implementing this. It wasn't too hard, especially since ask_bool and Path::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:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

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.

Keats and others added 4 commits July 19, 2021 20:15
Added `ask_bool` prompt for `--output-dir` for when the output directory
targeted already exists in the file system.

[Issue: #1378]
Copy link
Collaborator

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

@coastalwhite
Copy link
Contributor Author

There is now a 10s prompt timeout using tokio's timeout.

@Keats Keats merged commit eceb1bd into getzola:next Sep 4, 2021
@Keats
Copy link
Collaborator

Keats commented Sep 4, 2021

Thanks!

@Yaroslav-95
Copy link
Contributor

Yaroslav-95 commented Sep 11, 2022

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)

thomasantony pushed a commit to thomasantony/zola that referenced this pull request Sep 17, 2022
…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]>
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