Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ iojs@1.6.3 #1342

Merged
merged 2 commits into from
Apr 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 18 additions & 3 deletions tools/coffee2c.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env python

import contextlib
import os
import subprocess
import sys


SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))


def main():
natives = sys.argv[1]
natives = os.path.abspath(sys.argv[1])
coffee_source_files = sys.argv[2:]

output_dir = os.path.dirname(natives)
Expand All @@ -35,7 +36,21 @@ def call_compile_coffee(source_file, output_filename):

def call_js2c(natives, js_source_files):
js2c = os.path.join(SOURCE_ROOT, 'vendor', 'node', 'tools', 'js2c.py')
subprocess.check_call([sys.executable, js2c, natives] + js_source_files)
src_dir = os.path.dirname(js_source_files[0])
with scoped_cwd(src_dir):
subprocess.check_call(
[sys.executable, js2c, natives] +
[os.path.basename(source) for source in js_source_files])


@contextlib.contextmanager
def scoped_cwd(path):
cwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(cwd)


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion vendor/node
Submodule node updated 1777 files