from __future__ import print_function

from pipeline.compilers import SubProcessCompiler
from os.path import dirname
from django.conf import settings


import pdb

class BrowserifyCompiler(SubProcessCompiler):
    output_extension = 'js'

    def match_file(self, filename):
        return filename.endswith('cjsx')

    def compile_file(self, infile, outfile, outdated=False, force=False):
        command = "%s %s %s %s > %s" % (
            getattr(settings, 'PIPELINE_BROWSERIFY_VARS', ''),
            getattr(settings, 'PIPELINE_BROWSERIFY_BINARY', '/usr/bin/env browserify'),
            getattr(settings, 'PIPELINE_BROWSERIFY_ARGUMENTS', '-t coffee-reactify --extension=".cjsx" --extension=".coffee"'),
            infile,
            outfile
        )

        return self.execute_command(command, cwd=dirname(infile))


@@ -149,20 +149,8 @@
 s%0A%0A%0A
-import pdb%0A%0A
 clas

remove pdb from testing