Skip to content

Commit 78e73cb

Browse files
committed
bug correction: livescript's compiler can fail with the source map generation if the 'compiled' folder isn't already present
1 parent 89f545f commit 78e73cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

static_precompiler/compilers/livescript.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def __init__(self, executable='lsc', sourcemap_enabled=False):
2424

2525
def compile_file(self, source_path):
2626
full_output_path = self.get_full_output_path(source_path)
27+
# LiveScript bug with source map if the folder isn't already present
28+
if not os.path.exists(os.path.dirname(full_output_path)):
29+
os.makedirs(os.path.dirname(full_output_path))
2730
args = [
2831
self.executable,
2932
"-c",
@@ -41,7 +44,7 @@ def compile_file(self, source_path):
4144
raise exceptions.StaticCompilationError(errors)
4245

4346
if self.is_sourcemap_enabled:
44-
# Livescript writes source maps to compiled.map, not compiled.js.map
47+
# Livescript writes source maps to compiled.js.map
4548
sourcemap_full_path = full_output_path + ".map"
4649

4750
with open(sourcemap_full_path) as sourcemap_file:

0 commit comments

Comments
 (0)