-
Notifications
You must be signed in to change notification settings - Fork 247
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
Detecting modifications as additions in docker w/ osxfs mounted volume #420
Comments
for folks looking for a guard-rspec temporary workaround, using this monkey patch from guard/guard-rspec#391 worked for me class Guard::RSpec
def run_on_additions(paths)
return false if paths.empty?
_throw_if_failed { runner.run(paths) }
end
end |
#434 says |
Had a difficult time finding a way to monkey patch Guardfile: guard :rpsec, cmd: "bundle exec rspec" do
Guard::RSpec.class_eval { alias_method :run_on_additions, :run_on_modifications }
...
end |
We recently changed I'm hoping the above addressed this issue, so I'm going to close it. |
I'm editing my files using vim on OSX. Guard is running inside a docker container with my local (host) source directory mounted into the container.
Problem: Editing files with vim doesn't trigger modification events but addition events. Editing with other editors (e.g. atom) does.
So inside the container, I checked what happens by watching the output of
inotifywait -m -r .
when opening test.txt with vim, adding a space and saving it:I see some stuff I don't (want to) understand (a file called 4913, multiple deletes on the swap files, multiple modifies on test.txt).
Now, let's open the file in atom, add a space and save it:
It seems like the
MODIFY
event is making it into the container in both cases, howeverlisten
doesn't seem to pick it up. So inside the container, I ran this snippet from the troubleshooting docs and did the same "edit in vim, edit in atom" cycle:Editing the file in vim, adding a space and saving yields:
Editing the file in atom and saving yields:
The fact that with
inotifywait -m -r .
I saw theMODIFY test.txt
but at the same time with listen I saw anaddition
of test.txt makes me think that this might be a bug inlisten
, then again I don't really know what I'm talking about (i.e. why would there be twoMODIFY
(or from listen's point of view twoadded
s) when I just save the file once)?I came across this when noticing that
guard-rspec
doesn't notice any of my edited files, but other guards likeguard-bundler
did. But I am assuming, that any guard that's listening tomodification
s (and notaddition
s) is probably broken in many docker based development workflows that involve running things with guard inside docker on osx.P.S.
P.P.S.
Versions:
The text was updated successfully, but these errors were encountered: