summaryrefslogtreecommitdiff
path: root/tools/build_third_party.py
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2018-07-04 22:04:59 +0900
committerRyan Dahl <ry@tinyclouds.org>2018-07-04 15:04:59 +0200
commit2060bc939d792d0dacb8be7b8e989141300b1ce5 (patch)
tree8028a573b0d6ab89ad837445d77d2dff5af24e21 /tools/build_third_party.py
parent15d6541d4d276c7e36c1d0a42292c85682ddeb25 (diff)
Add tools/build_third_party.py (#328)
Fixes #312
Diffstat (limited to 'tools/build_third_party.py')
-rwxr-xr-xtools/build_third_party.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/build_third_party.py b/tools/build_third_party.py
new file mode 100755
index 000000000..caaf3bfaf
--- /dev/null
+++ b/tools/build_third_party.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# This script updates the third party dependencies of deno.
+# - Get Depot Tools and make sure it's in your path.
+# http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up
+# - You need yarn installed as well.
+# https://yarnpkg.com/lang/en/docs/install/
+# Use //gclient_config.py to modify the git deps.
+# Use //js/package.json to modify the npm deps.
+
+import os
+import subprocess
+import argparse
+
+root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+third_party_path = os.path.join(root_path, "third_party")
+script_name = "build_third_party.py"
+
+parser = argparse.ArgumentParser(description="""
+This script updates the third party dependencies of deno.
+""")
+parser.parse_args()
+
+def main():
+ os.chdir(third_party_path)
+ run(["gclient", "sync", "--no-history"])
+ run(["yarn"])
+ print "Done (" + script_name + ")"
+
+def run(args):
+ print " ".join(args)
+ env = os.environ.copy()
+ subprocess.check_call(args, env=env)
+
+if '__main__' == __name__:
+ main()