Advertisement
MrDini

gn.py source

Feb 6th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.77 KB | None | 0 0
  1. import gclient_utils
  2. import os
  3. import subprocess
  4. import sys
  5.  
  6.  
  7. def main(args):
  8.   bin_path = gclient_utils.GetBuildtoolsPlatformBinaryPath()
  9.   if not bin_path:
  10.     print >> sys.stderr, ('gn.py: Could not find checkout in any parent of '
  11.                           'the current path.\nThis must be run inside a '
  12.                           'checkout.')
  13.     return 1
  14.   gn_path = os.path.join(bin_path, 'gn' + gclient_utils.GetExeSuffix())
  15.   if not os.path.exists(gn_path):
  16.     print >> sys.stderr, 'gn.py: Could not find gn executable at: %s' % gn_path
  17.     return 2
  18.   else:
  19.     return subprocess.call([gn_path] + args[1:])
  20.  
  21.  
  22. if __name__ == '__main__':
  23.   try:
  24.     sys.exit(main(sys.argv))
  25.   except KeyboardInterrupt:
  26.     sys.stderr.write('interrupted\n')
  27.     sys.exit(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement