Chromium Code Reviews| Index: tools/run_hooks.py |
| diff --git a/tools/run_hooks.py b/tools/run_hooks.py |
| index 478391bbca482d5da9ea42424dff8001cfe40577..45f0c41569d31622721eca109943d6dafca0abc0 100755 |
| --- a/tools/run_hooks.py |
| +++ b/tools/run_hooks.py |
| @@ -23,11 +23,18 @@ def main(args): |
| with open(deps_path) as deps_contents: |
| d = deps_contents.read() |
| exec(d, scope) |
| + env = os.environ |
| + # Some hooks expect depot_tools to be in the PATH already so add the default |
| + # location of depot_tools in a standard checkout to the environment the hooks |
| + # run in. |
| + default_depot_tools_path = os.path.abspath(os.path.join(gclient_path, |
| + "depot_tools")) |
| + env["PATH"] = env["PATH"] + ":" + default_depot_tools_path |
|
viettrungluu
2016/03/04 20:46:09
+= ?
(Also, I'd suggest os.pathsep instead of ":"
|
| for hook in scope["hooks"]: |
| name = hook["name"] |
| print "________ running '%s' in '%s'" % (" ".join(hook["action"]), |
| gclient_path) |
| - subprocess.check_call(hook["action"], cwd=gclient_path) |
| + subprocess.check_call(hook["action"], cwd=gclient_path, env=env) |
| return 0 |