def _compile(files, config, outfile_for):
flags = to_flags(config['compile'])
compiled = []
for f in files:
in_file = os.path.join(config['root'], f)
out_file = outfile_for(f)
# Make sure output folder exists
mkdir_p(os.path.dirname(out_file))
command = [sass.path] + flags + [in_file, out_file]
p = Popen(command, stdout=PIPE, stderr=PIPE, **_platform_opts)
out, err = p.communicate()
if err:
print(u"Error: {0}".format(err))
print(u"Command: {0}".format(" ".join(command)))
sublime.error_message(u"Failed to compile {0}\n\nView error with Ctrl+`".format(f))
return
compiled.append(f)
return compiled
评论列表
文章目录