cespare / reflex

Run a command when files change

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling `Chmod` seems to be needed when using dinghy

fgrehm opened this issue · comments

commented

Hey there, sorry for bringing this up out of nowhere but in order to get reflex to play fine with dinghy I had to delete the code that ignored fsnotify.Chmod because that's the event we get when the tool that is used under the hood forwards events to the boot2docker VM by touching the file on the VM 😢

Sorry but this is my first time looking at reflex sources and I was wondering what would be the reason for having that logic around. Would it make sense to provide a flag to consider those events?

Not sure if you are familiar with Docker / Dinghy / Boot2Docker so let me know if you need any additional context.

/cc @codekitchen so that you know that there might be other tools that might have a hard time detecting changes right away when using dinghy, feel free to unsubscribe to the issue in case you don't want to get updates about it.

Thanks for bringing this to my attention. For background for why that code is like that, see the two (OS X specific?) issues #11 and #23.

I'll have to look into what differences there are with fsnotify events on OS X vs. Linux (perhaps after upgrading to latest fsnotify). It's possible that some of this reasoning is no longer valid.

I'd prefer not to add another flag to configure the changes reflex watches for, but it's possible that there are mutually exclusive use cases that would make such configuration necessary.

Any research help would be helpful :)

commented

Here's an asciicast demoing the current behavior. Please note that when I mention that no events got triggered after removing a file is expected that is related to using NFS to share files between my machine and the VM

Hope that helps!

added a PR that allows watching chmod only changes as I had the same problem with docker native OSX (their latest revision broke inotify)