diff piecrust/processing/sass.py @ 1112:a3dec0fbd9ce

bake: Fix bug on Windows where shim scripts of NodeJS tools couldn't run.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 20 Feb 2018 22:15:57 -0800
parents e00ff3dcb5ec
children
line wrap: on
line diff
--- a/piecrust/processing/sass.py	Sun Feb 18 20:37:54 2018 -0800
+++ b/piecrust/processing/sass.py	Tue Feb 20 22:15:57 2018 -0800
@@ -83,11 +83,8 @@
         args += [in_path, out_path]
         logger.debug("Processing Sass file: %s" % args)
 
-        # On Windows, we need to run the process in a shell environment
-        # otherwise it looks like `PATH` isn't taken into account.
-        shell = (platform.system() == 'Windows')
         try:
-            retcode = subprocess.call(args, shell=shell)
+            retcode = subprocess.call(args)
         except FileNotFoundError as ex:
             logger.error("Tried running Sass processor with command: %s" %
                          args)
@@ -114,8 +111,12 @@
         if self._conf is not None:
             return
 
+        bin_name = 'scss'
+        if platform.system() == 'Windows':
+            bin_name += '.cmd'
+
         self._conf = self.app.config.get('sass') or {}
-        self._conf.setdefault('bin', 'scss')
+        self._conf.setdefault('bin', bin_name)
         self._conf.setdefault('style', 'nested')
         self._conf.setdefault('load_paths', [])
         if not isinstance(self._conf['load_paths'], list):