Commit a735da2a authored by stip@chromium.org's avatar stip@chromium.org

Add `gclient root` command which outputs the current solution's root.

NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1113453007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295075 0039d316-1c4b-4281-b951-d872f2087c98
parent 8ba1ddb3
......@@ -1824,6 +1824,16 @@ def CMDgrep(parser, args):
'git', 'grep', '--null', '--color=Always'] + args)
def CMDroot(parser, args):
"""Outputs the solution root (or current dir if there isn't one)."""
(options, args) = parser.parse_args(args)
client = GClient.LoadCurrentConfig(options)
if client:
print(os.path.abspath(client.root_dir))
else:
print(os.path.abspath('.'))
@subcommand.usage('[url] [safesync url]')
def CMDconfig(parser, args):
"""Creates a .gclient file in the current directory.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment