Skip to content

Commit 0946800

Browse files
authored
Merge pull request #1117 from cloudfoundry/ivanovac-patch-1
Add check for existing CF CLI installation
2 parents a9d0b6a + 81d149c commit 0946800

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/.util/tools.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,17 @@ function util::tools::cf::install() {
148148
exit 1
149149
esac
150150

151+
# Check if cf is already available in PATH (e.g., from system/Docker image)
152+
if command -v cf &> /dev/null; then
153+
util::print::title "CF CLI already installed (using system version)"
154+
cf version
155+
return 0
156+
fi
157+
151158
if [[ ! -f "${dir}/cf" ]]; then
152159
util::print::title "Installing cf"
153160

154-
curl "https://packages.cloudfoundry.org/stable?release=${os}-binary&version=6.49.0&source=github-rel" \
161+
curl "https://packages.cloudfoundry.org/stable?release=${os}-binary&source=github-rel" \
155162
--silent \
156163
--location \
157164
--output /tmp/cf.tar.gz

0 commit comments

Comments
 (0)