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

Side by Side Diff: tools/run_hooks.py

Issue 1577373002: Add script to run gclient hooks for jiri (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium 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 script runs all of the hooks specified in DEPS in order.
7
8 import os
9 import subprocess
10 import sys
11
12 scope = {}
13
14 def Var(key):
15 return scope["vars"][key]
16
17 scope["Var"] = Var
18
19 def main(args):
20 gclient_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
21 os.pardir, os.pardir))
22 deps_path = os.path.join(gclient_path, "src", "DEPS")
23 with open(deps_path) as deps_contents:
24 d = deps_contents.read()
25 exec(d, scope)
26 for hook in scope["hooks"]:
27 name = hook["name"]
28 print "________ running '%s' in '%s'" % (" ".join(hook["action"]),
29 gclient_path)
30 subprocess.check_call(hook["action"], cwd=gclient_path)
31 print
32
33 if __name__ == '__main__':
34 sys.exit(main(sys.argv[1:]))
viettrungluu 2016/01/12 23:09:00 nit: If you're going to do this, |main()| should p
OLDNEW
« 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