Watch reload infinite loop
tiagokrebs opened this issue · 1 comments
tiagokrebs commented
Through Hugo preset and this project, when I open Neovim on the root path of the project for some reason a watcher waiting for changes on the code (I supose) retriggers de dev
command, when it's really not needed, event though I'm not making any changes on the source myself.
- I know for a fact Neovim changes files when opened, here is what it change without the
dev
command up:
$ fswatch .
/Users/tiago.krebs/Projetos/tiagokrebs.com/.git/modules/themes/hugo-coder/index.lock
/Users/tiago.krebs/Projetos/tiagokrebs.com/.git/index.lock
/Users/tiago.krebs/Projetos/tiagokrebs.com/.git/index
/Users/tiago.krebs/Projetos/tiagokrebs.com/.git/index
/Users/tiago.krebs/Projetos/tiagokrebs.com/.git/modules/themes/hugo-coder/index.lock
- It's obvious that the
dev
command changes a lot of things when I run it, but it seems to change two times:
$ fswatch .
[...]
/Users/tiago.krebs/Projetos/tiagokrebs.com/vulcan-20240518082209.temp.js
/Users/tiago.krebs/Projetos/tiagokrebs.com/public
[...]
/Users/tiago.krebs/Projetos/tiagokrebs.com/vulcan-20240518082209.temp.js <--- again
/Users/tiago.krebs/Projetos/tiagokrebs.com/public/404.html <--- again
[...]
- When I have the
dev
command up and open Neovim things go crazy. Neovim triggers those changes inside.git
, then the watcher changes a lot of things on the folder, Neovim seems like to catch that and changes things inside the.git
again, which triggers thedev
command one more time. This keeps repeating to infinity.
Gravacao.de.Tela.2024-05-18.as.08.09.59.mov
Maybe the watcher should ignore the .git
folder?
jotanarciso commented
Nice!