Work around long path deletion problem on Windows.
BUG=None
R=kjellander@chromium.org
Review URL: https://codereview.chromium.org/977833003
git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/webrtc/webrtc.DEPS@294318 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/copy_apprtc.py b/copy_apprtc.py
index 2ed2e95..8cc40b1 100755
--- a/copy_apprtc.py
+++ b/copy_apprtc.py
@@ -10,6 +10,8 @@
import shutil
import sys
+import utils
+
def _ConfigureApprtcServerToDeveloperMode(app_yaml_path):
if not os.path.exists(app_yaml_path):
@@ -25,7 +27,12 @@
def main():
target_dir = os.path.join('src', 'out', 'apprtc')
- shutil.rmtree(target_dir, ignore_errors=True)
+ if utils.GetPlatform() is 'win':
+ # Windows shutil can't handle the long node.js paths when deleting;
+ # work around the problem.
+ os.system('rmdir /s /q %s' % target_dir)
+ else:
+ shutil.rmtree(target_dir, ignore_errors=True)
shutil.copytree('apprtc',
target_dir, ignore=shutil.ignore_patterns('.svn', '.git'))