__init__.py 541 Bytes
Newer Older
1 2
import os.path

3 4
from pipeline.conf import settings
from pipeline.compilers import SubProcessCompiler
Timothée Peignier committed
5 6 7


class SASSCompiler(SubProcessCompiler):
Timothée Peignier committed
8 9
    output_extension = 'css'

Timothée Peignier committed
10 11 12
    def match_file(self, filename):
        return filename.endswith('.scss')

13 14 15 16 17 18
    def compile_file(self, content, path):
        command = "%s --scss %s %s" % (
            settings.PIPELINE_SASS_BINARY,
            settings.PIPELINE_SASS_ARGUMENTS,
            path
        )
19 20
        cwd = os.path.dirname(path)
        return self.execute_command(command, cwd=cwd)