Index: build_apprtc_closure.py |
=================================================================== |
--- build_apprtc_closure.py (revision 293823) |
+++ build_apprtc_closure.py (working copy) |
@@ -9,6 +9,7 @@ |
the node toolchain we downloaded earlier. |
""" |
+import fileinput |
import os |
import shutil |
import sys |
@@ -16,6 +17,17 @@ |
import utils |
+# Phantomjs generates very deep paths in the node_modules structure and |
+# Windows can't deal with that, so just hack that out. |
+def _WorkaroundPhantomJsOnWin(samples_path): |
+ if utils.GetPlatform() is 'win': |
+ package_json = os.path.join(samples_path, 'package.json') |
+ |
+ for line in fileinput.input(package_json, inplace=True): |
kjellander_chromium
2015/01/27 21:00:30
Ha, I didn't know about this module. Very neat for
phoglund_chromium
2015/01/28 08:29:02
It is short, but it's really, really strange that
|
+ if not 'phantomjs' in line: |
+ print line |
+ |
+ |
def main(): |
node_path = os.path.abspath('node') |
if not os.path.exists(node_path): |
@@ -25,6 +37,7 @@ |
return 'Expected webrtc-samples at %s.' % os.path.abspath(samples_path) |
os.chdir(samples_path) |
+ _WorkaroundPhantomJsOnWin(samples_path) |
if utils.GetPlatform() is 'win': |
npm_bin = os.path.join(node_path, 'npm.cmd') |