Commit 31df862b by Timothée Peignier

change cwd for less and sass compiler

parent 5c421949
......@@ -68,9 +68,10 @@ class CompilerError(Exception):
class SubProcessCompiler(CompilerBase):
def execute_command(self, command, content=None):
pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
def execute_command(self, command, content=None, cwd=None):
pipe = subprocess.Popen(command, shell=True, cwd=cwd,
stdout=subprocess.PIPE, stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
if content:
pipe.stdin.write(content)
......
import os.path
from pipeline.conf import settings
from pipeline.compilers import SubProcessCompiler
......@@ -14,5 +16,6 @@ class LessCompiler(SubProcessCompiler):
settings.PIPELINE_LESS_ARGUMENTS,
path
)
content = self.execute_command(command)
cwd = os.path.dirname(path)
content = self.execute_command(command, cwd=cwd)
return content
import os.path
from pipeline.conf import settings
from pipeline.compilers import SubProcessCompiler
......@@ -14,4 +16,5 @@ class SASSCompiler(SubProcessCompiler):
settings.PIPELINE_SASS_ARGUMENTS,
path
)
return self.execute_command(command)
cwd = os.path.dirname(path)
return self.execute_command(command, cwd=cwd)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment