Index: copy_apprtc.py |
=================================================================== |
--- copy_apprtc.py (revision 293799) |
+++ copy_apprtc.py (working copy) |
@@ -10,13 +10,25 @@ |
understand those symlinks). |
""" |
+import os |
import shutil |
+import utils |
if __name__ == '__main__': |
- web_samples_dir = 'webrtc-samples/samples/web' |
- shutil.rmtree('src/out/apprtc', ignore_errors=True) |
- shutil.copytree(web_samples_dir + '/content/apprtc', |
- 'src/out/apprtc', ignore=shutil.ignore_patterns('.svn')) |
- shutil.copyfile(web_samples_dir + '/js/adapter.js', |
- 'src/out/apprtc/js/adapter.js') |
+ target_dir = os.path.join('src', 'out', 'webrtc-samples') |
+ if utils.GetPlatform() is 'win': |
+ # Work around the fact that node_modules create ridiculously long paths. |
+ # Unfortunately shutil will choke on those on Windows, but not rmdir. |
+ os.system('rmdir /s /q %s' % target_dir) |
+ else: |
+ shutil.rmtree(target_dir, ignore_errors=True) |
+ shutil.copytree('webrtc-samples', |
+ target_dir, ignore=shutil.ignore_patterns('.svn', '.git')) |
+ apprtc_subdir = os.path.join('samples', 'web', 'content', 'apprtc') |
+ |
+ # This file is symlinked on windows, so copy it since win doesn't understand |
+ # symlinks. |
+ shutil.copyfile(os.path.join('webrtc-samples', 'samples', 'web', |
+ 'js', 'adapter.js'), |
+ os.path.join(target_dir, apprtc_subdir, 'js', 'adapter.js')) |