diff --git a/docs/compressors.rst b/docs/compressors.rst index 6387aa4b..874dbb55 100644 --- a/docs/compressors.rst +++ b/docs/compressors.rst @@ -264,3 +264,15 @@ Add it to your settings :: PIPELINE['CSS_COMPRESSOR'] = 'jam.compressors.JamCompressor' PIPELINE['JS_COMPRESSOR'] = 'jam.compressors.JamCompressor' + + +Use Shell to run compressor binary (Windows) +============================================ + +If you have a compressor binary such as Yuglify installed globally using NPM on windows, you can enable ``'USE_SHELL'``, +that way it just searches your PATH. + +Then in your settings you could use: :: + + PIPELINE['USE_SHELL'] = True + PIPELINE['YUGLIFY_BINARY']: 'yuglify' diff --git a/pipeline/compressors/__init__.py b/pipeline/compressors/__init__.py index 4528577b..6529e2ff 100644 --- a/pipeline/compressors/__init__.py +++ b/pipeline/compressors/__init__.py @@ -244,7 +244,7 @@ def execute_command(self, command, content): argument_list.extend(flattening_arg) pipe = subprocess.Popen(argument_list, stdout=subprocess.PIPE, - stdin=subprocess.PIPE, stderr=subprocess.PIPE) + stdin=subprocess.PIPE, stderr=subprocess.PIPE, shell=settings.USE_SHELL) if content: content = smart_bytes(content) stdout, stderr = pipe.communicate(content) diff --git a/pipeline/conf.py b/pipeline/conf.py index 085a1e22..71512d63 100644 --- a/pipeline/conf.py +++ b/pipeline/conf.py @@ -78,6 +78,8 @@ 'LESS_BINARY': '/usr/bin/env lessc', 'LESS_ARGUMENTS': '', + 'USE_SHELL': False, + 'MIMETYPES': ( (b'text/coffeescript', '.coffee'), (b'text/less', '.less'),