From 53e9f139c68ccdd27983bc650be7c139a644fefd Mon Sep 17 00:00:00 2001 From: ivanovac Date: Thu, 11 Dec 2025 15:19:56 +0200 Subject: [PATCH] Fix CF CLI installation to use system version when available --- 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..a3df593ad 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 already exists in the target directory or system PATH + if [[ -f "${dir}/cf" ]] || command -v cf >/dev/null 2>&1; 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