Do not fail cogsetup.sh if repo is not in PATH

Change-Id: Id1588ac710963d14edfb485daf2b3b14c857ae69
This commit is contained in:
Michael Merg 2024-04-26 07:09:41 +00:00
parent 45c6fd0c17
commit f3fae6bbc9

View file

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