OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2014 the V8 project authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 """This program wraps an arbitrary command since gn currently can only execute |
| 7 scripts.""" |
| 8 |
| 9 import os |
| 10 import subprocess |
| 11 import sys |
| 12 |
| 13 try: |
| 14 env = os.environ |
| 15 if "PATH" in env: |
| 16 path = env["PATH"] |
| 17 if "cygwin" in path: |
| 18 # Needed to make pkgdata and similar work. |
| 19 print("Removing cygwin from path.") |
| 20 parts = path.split(";") |
| 21 path = ";".join([x for x in parts if not "cygwin" in x]) |
| 22 env["PATH"] = path |
| 23 res = subprocess.call(sys.argv[1:], env=env) |
| 24 except Exception as e: |
| 25 res = 1 |
| 26 print("%s" % e) |
| 27 |
| 28 if res != 0: |
| 29 print("In %s" % os.getcwd()) |
| 30 print("%s" % sys.argv) |
| 31 |
| 32 sys.exit(res) |
OLD | NEW |