Index: build/config/mac/xcrun.py |
diff --git a/build/config/mac/xcrun.py b/build/config/mac/xcrun.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e2a775e51588bc58aea832544c35e2ef18cd5061 |
--- /dev/null |
+++ b/build/config/mac/xcrun.py |
@@ -0,0 +1,23 @@ |
+# Copyright 2016 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import argparse |
+import os |
+import subprocess |
+import sys |
+ |
+if __name__ == '__main__': |
+ parser = argparse.ArgumentParser( |
+ description='A script to execute a command via xcrun.') |
+ parser.add_argument('--stamp', action='store', type=str, |
+ help='Write a stamp file to this path on success.') |
+ args, unknown_args = parser.parse_known_args() |
+ |
+ rv = subprocess.check_call(['xcrun'] + unknown_args) |
+ if rv == 0 and args.stamp: |
+ if os.path.exists(args.stamp): |
+ os.unlink(args.stamp) |
+ open(args.stamp, 'w+').close() |
+ |
+ sys.exit(rv) |