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

Unified Diff: gn.py

Issue 538393002: Make gn.py support root directories other than 'src'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Improved readability and returning non-zero exit code on failure to find gn Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gclient_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gn.py
diff --git a/gn.py b/gn.py
index e3bcc978356f7e473387629fa57352efb3dff31b..325e685d776035651a8b6c4c6a5d9dd0ee233883 100755
--- a/gn.py
+++ b/gn.py
@@ -24,9 +24,13 @@ def main(args):
print >> sys.stderr, ('gn.py: Could not find checkout in any parent of '
'the current path.\nThis must be run inside a '
'checkout.')
- sys.exit(1)
+ return 1
gn_path = os.path.join(bin_path, 'gn' + gclient_utils.GetExeSuffix())
- return subprocess.call([gn_path] + sys.argv[1:])
+ 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] + sys.argv[1:])
if __name__ == '__main__':
« no previous file with comments | « gclient_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698