Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import gclient_utils
- import os
- import subprocess
- import sys
- def main(args):
- bin_path = gclient_utils.GetBuildtoolsPlatformBinaryPath()
- if not bin_path:
- print >> sys.stderr, ('gn.py: Could not find checkout in any parent of '
- 'the current path.\nThis must be run inside a '
- 'checkout.')
- return 1
- gn_path = os.path.join(bin_path, 'gn' + gclient_utils.GetExeSuffix())
- if not os.path.exists(gn_path):
- print >> sys.stderr, 'gn.py: Could not find gn executable at: %s' % gn_path
- return 2
- else:
- return subprocess.call([gn_path] + args[1:])
- if __name__ == '__main__':
- try:
- sys.exit(main(sys.argv))
- except KeyboardInterrupt:
- sys.stderr.write('interrupted\n')
- sys.exit(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement