Skip to content

Commit

Permalink
Merge pull request #3 from sbc100/dont_ignore_node_modules
Browse files Browse the repository at this point in the history
Don't remove top level node_modules from emscripten package
  • Loading branch information
juj authored Jan 8, 2019
2 parents cef8e88 + 9fd35cc commit c4c6b03
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions bin/deploy_emscripten_llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,7 @@ def deploy_emscripten(llvm_source_dir, emscripten_source_dir, emscripten_output_
print 'Zipping up "' + zip_filename + '"'
if os.path.isfile(zip_filename): os.remove(zip_filename)

# We want to ignore the root '/node_modules' directory from the zip, but there are other node_modules directories in the Emscripten tree
# which do need to get in to the generated zip. The simplest way seems to be to temporarily rename the root node_modules directory to
# a different name, which will be ignored during zipping.
if os.path.isdir(os.path.join(emscripten_output_dir, 'node_modules')):
os.rename(os.path.join(emscripten_output_dir, 'node_modules'), os.path.join(emscripten_output_dir, 'node_modules_ignore'))
try:
zip_up_directory(emscripten_output_dir, zip_filename, ['.git', 'node_modules_ignore', 'third_party/lzma.js/', '*.pyc'])
finally:
if os.path.isdir(os.path.join(emscripten_output_dir, 'node_modules_ignore')):
os.rename(os.path.join(emscripten_output_dir, 'node_modules_ignore'), os.path.join(emscripten_output_dir, 'node_modules'))
zip_up_directory(emscripten_output_dir, zip_filename, ['.git', 'third_party/lzma.js/', '*.pyc'])

print zip_filename + ': ' + str(os.path.getsize(zip_filename)) + ' bytes.'

Expand Down

0 comments on commit c4c6b03

Please sign in to comment.