diff --git a/gclient.py b/gclient.py index a14499d48..56f506ea7 100755 --- a/gclient.py +++ b/gclient.py @@ -1655,8 +1655,7 @@ class GitDependency(Dependency): def _IsCog(): """Returns true if the env is cog""" if GitDependency._is_env_cog is None: - GitDependency._is_env_cog = os.getcwd().startswith( - '/google/cog/cloud') + GitDependency._is_env_cog = gclient_utils.IsEnvCog() return GitDependency._is_env_cog diff --git a/gclient_utils.py b/gclient_utils.py index dadd208e0..00eb681d9 100644 --- a/gclient_utils.py +++ b/gclient_utils.py @@ -1201,6 +1201,11 @@ def RunEditor(content, git, git_editor=None): os.remove(filename) +def IsEnvCog(): + """Returns whether the command is running in a Cog environment.""" + return os.getcwd().startswith('/google/cog/cloud') + + def UpgradeToHttps(url): """Upgrades random urls to https://.