Merge "Do not fail cogsetup.sh if repo is not in PATH" into main am: 0c16cb6a66

Original change: https://android-review.googlesource.com/c/platform/build/+/3047036

Change-Id: I863561ed9ecd4af6889ab55d33bd3c1146c85097
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Gaurav Johari
2024-04-29 17:10:43 +00:00
committed by Automerger Merge Worker

View File

@@ -52,7 +52,9 @@ function _setup_cog_env() {
# it with this function. If the user is running repo within a Cog workspace,
# we'll fail with an error, otherwise, we run the original repo command with
# the given args.
ORIG_REPO_PATH=`which repo`
if ! ORIG_REPO_PATH=`which repo`; then
return 0
fi
function repo {
if [[ "${PWD}" == /google/cog/* ]]; then
echo "\e[01;31mERROR:\e[0mrepo command is disallowed within Cog workspaces."