From 51d102ccd94d1fa37ab6b279dcf30b829ccb3efc Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Fri, 11 Nov 2016 14:48:32 +0100 Subject: [PATCH] Fixed sassassets module running compile from the wrong workingdir --- modules/sassassets.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/sassassets.py b/modules/sassassets.py index 853e5e2..fcbc2c8 100644 --- a/modules/sassassets.py +++ b/modules/sassassets.py @@ -31,13 +31,19 @@ class SassAssets(MessageMixin, RenderMixin, AssetsMixin): def compile_file(self, source_path, dest_path): print "Compiling %s to %s" % (source_path, dest_path) + source_dir = os.path.dirname(source_path) + original_dir = os.getcwd() + sass_file = open(source_path, 'r') css_file = open(dest_path, 'w') + os.chdir(source_dir) + sass_string = sass_file.read().decode('utf-8') css_string = sass.compile_str(sass_string) - css_file.write(css_string.encode('utf-8')) + os.chdir(original_dir) + sass_file.close() css_file.close()