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

Unified Diff: gyp/copy_file.py

Issue 930283002: Add SkCodec, including PNG implementation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Hacky fix for iOS. Created 5 years, 10 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 | « gyp/common_variables.gypi ('k') | gyp/libpng.gyp » ('j') | gyp/libpng.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gyp/copy_file.py
diff --git a/gyp/copy_file.py b/gyp/copy_file.py
new file mode 100644
index 0000000000000000000000000000000000000000..7268bf216ffbeafed37f81717c70f52bc629e477
--- /dev/null
+++ b/gyp/copy_file.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+# Copyright 2015 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Copy a file.
+"""
+
+import argparse
+import os
+import shutil
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+ parser.add_argument('src', help='File to copy.')
+ parser.add_argument('dst', help='Location to copy to.')
+ args = parser.parse_args()
+
+ src = os.path.abspath(os.path.join(os.getcwd(), args.src))
+ dst = os.path.abspath(os.path.join(os.getcwd(), args.dst))
+
+ print 'Copying from %s to %s' % (src, dst)
+
+ src_dir = os.path.dirname(src)
+ if not os.path.exists(src_dir):
+ raise AssertionError('src directory %s does not exist!' % src_dir)
+
+ if not os.path.exists(src):
+ raise AssertionError('file to copy %s does not exist' % src)
+
+ dst_dir = os.path.dirname(dst)
+ if not os.path.exists(dst_dir):
+ print 'dst directory %s does not exist! creating it!' % dst_dir
+ os.makedirs(dst_dir)
+
+ shutil.copyfile(src, dst)
« no previous file with comments | « gyp/common_variables.gypi ('k') | gyp/libpng.gyp » ('j') | gyp/libpng.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698