Don't call run_on_change guard method when there is no matched files.
This commit is contained in:
parent
eebd74b253
commit
85beb5e97a
@ -30,6 +30,7 @@ module Guard
|
|||||||
Interactor.init_signal_traps
|
Interactor.init_signal_traps
|
||||||
|
|
||||||
listener.on_change do |files|
|
listener.on_change do |files|
|
||||||
|
if Watcher.match_files?(guards, files)
|
||||||
run do
|
run do
|
||||||
guards.each do |guard|
|
guards.each do |guard|
|
||||||
paths = Watcher.match_files(guard, files)
|
paths = Watcher.match_files(guard, files)
|
||||||
@ -37,6 +38,7 @@ module Guard
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
UI.info "Guard is now watching at '#{Dir.pwd}'"
|
UI.info "Guard is now watching at '#{Dir.pwd}'"
|
||||||
guards.each { |g| supervised_task(g, :start) }
|
guards.each { |g| supervised_task(g, :start) }
|
||||||
|
@ -30,5 +30,9 @@ module Guard
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.match_files?(guards, files)
|
||||||
|
guards.any? { |guard| !match_files(guard, files).empty? }
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user