summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-08-23 07:38:19 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-08-23 07:38:19 (GMT)
commit5dae5dacab500b01aec5f31e53e482ce0cb5991b (patch)
treef5abd05b1df8553cd1b2c5760077dfee52a4230b
parente107c8e2106ead1ebb4d2708d278ffc310e378ae (diff)
downloadmisc-fred-5dae5dacab500b01aec5f31e53e482ce0cb5991b.zip
misc-fred-5dae5dacab500b01aec5f31e53e482ce0cb5991b.tar.gz
misc-fred-5dae5dacab500b01aec5f31e53e482ce0cb5991b.tar.bz2
sassw: get events correctly when launched from a path != scss path
-rwxr-xr-xbin/sassw3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sassw b/bin/sassw
index 870bdde..acf3692 100755
--- a/bin/sassw
+++ b/bin/sassw
@@ -17,7 +17,8 @@ filename = sys.argv[1]
def build():
global sources, directories
subprocess.call(['sassc', '-mauto', filename, filename.replace('.scss', '.css')])
- sources = [os.path.abspath(x) for x in json.load(open(filename.replace('.scss', '.css.map')))['sources']]
+ 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']]
directories = set([os.path.dirname(x) for x in sources])
class EventManager(pyinotify.ProcessEvent):