Open koitsu opened 4 years ago
Hey there, this sounds like a good feature to add to me. Do you want to pick it up, or should I pick this up?
I do not have the cycles to implement this right now. If you could put it on your TODO list for some point in the future, I'd really appreciate it! No rush though. Thank you!
I have added it to the top of my todo list and will start working on it once I have some time. Will keep you posted!
This is a feature request.
Problem
Currently,
httpwatcher
watches for any changes in the directories provided.However, this poses a problem for people who use Vim which writes temporary files called "swap files" (unrelated to UNIX swap) to the same directory as the actual source file itself (e.g.
vim foo.md
will create a temporary file called.foo.md.swp
). In the case of Vim, these temporary files are updated extremely often (way more than I initially thought), which causeshttpwatcher
to notice changes -- and in turn, things like Statik to rebuild the site when it isn't necessary. Wasted CPU time, wasted I/O, wasted everything.While Vim has ways to work around this -- most of which are awful (e.g. using
/tmp
for this doesn't guarantee safety since many OSes have systemd services or cron jobs that clean out/tmp
periodically) -- this matter is not limited to just Vim.Comparatively:
livereload
has the ability to look for only certain file extensions of files that have changed.I'll add that other "live filesystem change-monitoring" programs tend to ignore dotfiles as they're treated as "hidden" (so-to-speak; yes I am well aware that
inotify(7)
on Linux andkqueue(2)
on BSD and other implementations do not differentiate dotfiles from non-dotfiles, but this is one of several reasons why software using those implementations ignore dotfiles). This approach alleviates the issue too.Request Details
It would be nice if
httpwatcher
had one or more of these implemented (I personally don't care which one):watch_include_ext = ['*.md', '*.html']
watch_ignore_ext = ['*.swp']
Thank you!