run lessc via npm

This commit is contained in:
Min RK
2017-08-05 14:04:34 +02:00
parent 00a4aef607
commit 8a95066b2e
2 changed files with 4 additions and 5 deletions

View File

@@ -219,17 +219,15 @@ class CSS(BaseCommand):
style_css = pjoin(static, 'css', 'style.min.css')
sourcemap = style_css + '.map'
env = os.environ.copy()
env['PATH'] = npm_path
args = [
'lessc', '--clean-css',
'npm', 'run', 'lessc', '--', '--clean-css',
'--source-map-basepath={}'.format(static),
'--source-map={}'.format(sourcemap),
'--source-map-rootpath=../',
style_less, style_css,
]
try:
check_call(args, cwd=here, env=env, shell=shell)
check_call(args, cwd=here, shell=shell)
except OSError as e:
print("Failed to run lessc: %s" % e, file=sys.stderr)
print("You can install js dependencies with `npm install`", file=sys.stderr)