I am setting up an example project with the following structure:
Gemfile
Guardfile
The contents of these files:
source :rubygems
gem "guard"
gem "guard-shell"
and
guard 'shell' do
watch(/^test\.txt$/) {|m| `echo #{m.inspect} #{File.mtime(m[0])}` }
end
Then I continue to work guard. Whenever I repeat something in this file, the guard logs the change twice. In one shell:
$ echo blah >> test.txt
The protection works in the shell:
> [test.txt] 2012-06-26 00:40:22 +0200
> [test.txt] 2012-06-26 00:40:22 +0200
The same behavior takes into account vim / nano, etc. Interestingly, when I just start echo blah > test.txt, protection only works once.
Any idea how I can prevent this, or is this the expected behavior?
EDIT: open issue on github: https://github.com/guard/guard/issues/297#issuecomment-6586266
source
share