Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1106)

Unified Diff: Source/devtools/scripts/concatenate_application_code.py

Issue 653133002: DevTools: Fix non-clean debug_devtools build after r183664 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/scripts/concatenate_application_code.py
diff --git a/Source/devtools/scripts/concatenate_application_code.py b/Source/devtools/scripts/concatenate_application_code.py
index b5eb7248248386d518189987e9c88eb05e34b235..1de39a182d58f1f6bc07e1b7817029bc8afe19ab 100755
--- a/Source/devtools/scripts/concatenate_application_code.py
+++ b/Source/devtools/scripts/concatenate_application_code.py
@@ -65,6 +65,12 @@ def hardlink_or_copy_dir(src, dest):
shutil.copy(src_name, dest_name)
+def safe_copy(src, dest):
+ if path.exists(dest):
+ os.remove(dest)
+ shutil.copy(src, dest)
+
+
class AppBuilder:
def __init__(self, application_name, descriptors, application_dir, output_dir):
self.application_name = application_name
@@ -209,7 +215,8 @@ class DebugBuilder(AppBuilder):
def build_app(self):
self._build_html()
- shutil.copy(join(self.application_dir, self.app_file('js')), self.output_dir)
+ js_name = self.app_file('js')
+ safe_copy(join(self.application_dir, js_name), join(self.output_dir, js_name))
for module_name in self.descriptors.modules:
module = self.descriptors.modules[module_name]
input_module_dir = join(self.application_dir, module_name)
@@ -218,7 +225,7 @@ class DebugBuilder(AppBuilder):
def _build_html(self):
html_name = self.app_file('html')
- shutil.copy(join(self.application_dir, html_name), join(self.output_dir, html_name))
+ safe_copy(join(self.application_dir, html_name), join(self.output_dir, html_name))
def build_application(application_name, loader, application_dir, output_dir, release_mode):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698