zola
zola copied to clipboard
zola serve not reloading when config.toml is changed
Bug Report
zola serve
does not detect changes to config.toml, but says it should
Environment
Linux Zola version: 0.17.2
Expected Behavior
Tell us what should have happened.
If config.toml gets written to, zola serve should reload
Current Behavior
Tell us what happens instead of the expected behavior. If you are seeing an
error, please include the full error message and stack trace. You can get the
stacktrace of a panic by adding RUST_BACKTRACE=1
when running a zola
command.
Nothing happens
Step to reproduce
Please provide the steps to reproduce the issue. If the issue is hard to reproduce, please provide a sample repository or sample that triggers the bug.
zola init
zola serve
vi config.toml
# edit a variable and save
Hm i've just tested locally and it works for me on Mac? Might be a OS specific issue
I just retested this on master and next builds, it looks like touch
triggers the reload but editing and saving in vi is not for me? I'm gonna poke around some more.
Specifically I am using nvim. I added a println! to the front of the match for watcher events and to the fallthrough _ branch. The first time I open and save a file with zola serve running, I get:
NoticeRemove("/home/.../config.toml")
Afterwards, touch fails to trigger a reload and saves in nvim and touches don't even register in the match handler...
https://github.com/notify-rs/notify/issues/247
hey this may be a necrobump, but for vim users if you do :
:set nobackup nowritebackup
that solves the issue, i know i had a similar issue with another software but i don't remember which, the culprit is that vim replaces the original file with a new one without that option and so a rust library that is used to track the file stop tracking it.
Can you try https://github.com/getzola/zola/pull/2269 as well without those options changed?
I took a crack at it in https://github.com/getzola/zola/pull/2498 .