sassw: get events correctly when launched from a path != scss path

This commit is contained in:
Frédéric Péters 2019-08-23 09:38:19 +02:00
parent e107c8e210
commit 5dae5dacab
1 changed files with 2 additions and 1 deletions

View File

@ -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):