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

Unified Diff: gclient_utils.py

Issue 356733002: Change clang_format.py to search for clang-format in buildtools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: updates Created 6 years, 6 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 | « clang_format.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index 655e5aa1b704e9c49dd0d626fe72c191201aa80f..9837cbb36c777dfdac67e4a7148dd5c48e1441b9 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -655,6 +655,19 @@ def GetBuildtoolsPath():
This is based on the root of the checkout containing the current directory."""
gclient_root = FindGclientRoot(os.getcwd())
if not gclient_root:
+ # Some projects might not use .gclient. Try to see whether we're in a git
+ # checkout.
+ top_dir = [os.getcwd()]
+ def filter_fn(line):
+ top_dir[0] = os.path.normpath(line.rstrip('\n'))
+ try:
+ CheckCallAndFilter(["git", "rev-parse", "--show-toplevel"],
+ print_stdout=False, filter_fn=filter_fn)
+ except Exception:
+ pass
+ top_dir = top_dir[0]
+ if os.path.exists(os.path.join(top_dir, 'buildtools')):
+ return os.path.join(top_dir, 'buildtools')
return None
return os.path.join(gclient_root, 'src', 'buildtools')
« no previous file with comments | « clang_format.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698