From 48de8f578f3488821d9796c12706827cecc89131 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Fri, 22 Jun 2018 20:20:30 +0200 Subject: [PATCH] Only compile if a dependency of the input file has been modified --- rubberin | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rubberin b/rubberin index 9bcfea6..292ec0a 100755 --- a/rubberin +++ b/rubberin @@ -191,6 +191,8 @@ dirs = files.map { |file| File.dirname(file) } dirs.each do |dir| # Set up a watch per directory notifier.watch(dir, :close_write) do |ev| + # Only compile if a dependency of the input file has been modified + next unless files.include?(dir + "/" + ev.name) puts "I: file #{ev.name} modified, compiling #{infile}..." compile(infile, mode) reload(infile, mode)