Commit 0db9a142 authored by zturner@chromium.org's avatar zturner@chromium.org

Allow chromium buildtools path to be overriden in the environment.

This is useful in certain (admittedly unsupported) cases 
when trying to use tools from depot_tools outside of a 
chrome repository.  In this particular case, I was trying 
to "git cl format" something that wasn't a chrome 
repository.

BUG=0

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@289412 0039d316-1c4b-4281-b951-d872f2087c98
parent 64e04008
...@@ -658,6 +658,13 @@ def GetMacWinOrLinux(): ...@@ -658,6 +658,13 @@ def GetMacWinOrLinux():
def GetBuildtoolsPath(): def GetBuildtoolsPath():
"""Returns the full path to the buildtools directory. """Returns the full path to the buildtools directory.
This is based on the root of the checkout containing the current directory.""" This is based on the root of the checkout containing the current directory."""
# Overriding the build tools path by environment is highly unsupported and may
# break without warning. Do not rely on this for anything important.
override = os.environ.get('CHROMIUM_BUILDTOOLS_PATH')
if override is not None:
return override
gclient_root = FindGclientRoot(os.getcwd()) gclient_root = FindGclientRoot(os.getcwd())
if not gclient_root: if not gclient_root:
# Some projects might not use .gclient. Try to see whether we're in a git # Some projects might not use .gclient. Try to see whether we're in a git
......
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