summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2021-01-17 18:48:32 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2021-01-17 18:48:32 (GMT)
commit8e4427dae64833ed4149b6e5517e9bb92f3b0ba9 (patch)
treeaad935872dea62dd182c2bf1d98a3b8ff1c3b1ee
parent80526c0055ff0c685e5a4fb8fa876c27b6ac0c5b (diff)
downloadmisc-fred-8e4427dae64833ed4149b6e5517e9bb92f3b0ba9.zip
misc-fred-8e4427dae64833ed4149b6e5517e9bb92f3b0ba9.tar.gz
misc-fred-8e4427dae64833ed4149b6e5517e9bb92f3b0ba9.tar.bz2
sassw: fix watching over sources
-rwxr-xr-xbin/sassw4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/sassw b/bin/sassw
index 0aa0b35..a8f0c3e 100755
--- a/bin/sassw
+++ b/bin/sassw
@@ -26,6 +26,7 @@ else:
def build():
global sources, directories
directories = set()
+ sources = set()
for filename in filenames:
result = subprocess.run(
['sassc', '-mauto', filename, filename.replace('.scss', '.css')],
@@ -43,7 +44,8 @@ def build():
}''' % result.stderr.replace('\n', '\\A').replace('"', '\\"'),
file=fd)
basepath = os.path.abspath(os.path.dirname(filename))
- sources = [os.path.abspath(os.path.join(basepath, x)) for x in json.load(open(filename.replace('.scss', '.css.map')))['sources']]
+ sources = sources.union(set([os.path.abspath(os.path.join(basepath, x))
+ for x in json.load(open(filename.replace('.scss', '.css.map')))['sources']]))
directories = directories.union(set([os.path.dirname(x) for x in sources]))
class EventManager(pyinotify.ProcessEvent):