From 81d149c3b8839e70c23eef47ad500608520cc37a Mon Sep 17 00:00:00 2001 From: Tsvetelina Marinova Date: Mon, 8 Dec 2025 14:41:59 +0200 Subject: [PATCH] Add check for existing CF CLI installation Added a check to see if CF CLI is already installed in PATH before attempting to install it. --- scripts/.util/tools.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/.util/tools.sh b/scripts/.util/tools.sh index dc8a55776..09a10f29f 100644 --- a/scripts/.util/tools.sh +++ b/scripts/.util/tools.sh @@ -148,10 +148,17 @@ function util::tools::cf::install() { exit 1 esac +# Check if cf is already available in PATH (e.g., from system/Docker image) + if command -v cf &> /dev/null; then + util::print::title "CF CLI already installed (using system version)" + cf version + return 0 + fi + if [[ ! -f "${dir}/cf" ]]; then util::print::title "Installing cf" - curl "https://packages.cloudfoundry.org/stable?release=${os}-binary&version=6.49.0&source=github-rel" \ + curl "https://packages.cloudfoundry.org/stable?release=${os}-binary&source=github-rel" \ --silent \ --location \ --output /tmp/cf.tar.gz