 Chromium Code Reviews
 Chromium Code Reviews Issue 1577373002:
  Add script to run gclient hooks for jiri  (Closed) 
  Base URL: git@github.com:domokit/mojo.git@master
    
  
    Issue 1577373002:
  Add script to run gclient hooks for jiri  (Closed) 
  Base URL: git@github.com:domokit/mojo.git@master| OLD | NEW | 
|---|---|
| (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
 | |
| OLD | NEW |