From f3fae6bbc9aea381e091c4f9a0e6d64d4eb1c45a Mon Sep 17 00:00:00 2001 From: Michael Merg Date: Fri, 26 Apr 2024 07:09:41 +0000 Subject: [PATCH] Do not fail cogsetup.sh if repo is not in PATH Change-Id: Id1588ac710963d14edfb485daf2b3b14c857ae69 --- cogsetup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cogsetup.sh b/cogsetup.sh index 44538f2a65..ef1485d5f2 100644 --- a/cogsetup.sh +++ b/cogsetup.sh @@ -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."