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

Unified Diff: gn.py

Issue 212173004: Fix the gn wrapper to be aware of the --root argument. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: remove TODO Created 6 years, 9 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 | « no previous file | 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 067f42e0f1ce62ab43eb5ed3fc55a7747d4e0689..ab08b52003ad5083f2d2284c94616d2fac819b1c 100755
--- a/gn.py
+++ b/gn.py
@@ -27,9 +27,21 @@ def RunGN(sourceroot):
def main(args):
+ for arg in sys.argv:
+ if arg.startswith('--root='):
+ sourceroot = arg.replace('--root=', '')
+ dotfile_path = os.path.join(sourceroot, '.gn')
+ if not os.path.exists(dotfile_path):
+ print >> sys.stderr, 'gn.py: "%s" not found, exiting.' % dotfile_path
+ sys.exit(1)
+ return RunGN(sourceroot)
+
sourceroot = gclient_utils.FindFileUpwards('.gn')
if not sourceroot:
- print >> sys.stderr, '.gn file not found in any parent of the current path.'
+ print >> sys.stderr, ('gn.py: No .gn file found in any parent of '
+ 'the current path.')
+ print >> sys.stderr, ('\nYou need to either be inside a checkout, '
+ 'or use --root to specify the checkout root.')
sys.exit(1)
return RunGN(sourceroot)
« 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