File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 44
55USERNAME=${USERNAME:- ${_REMOTE_USER:- " automatic" } }
66
7- set -e
7+ set -eo pipefail
88
99export TMPDIR=$( mktemp -d /tmp/feature.XXXXXX)
1010trap " rm -rf $TMPDIR " EXIT
@@ -101,12 +101,23 @@ export DEBIAN_FRONTEND=noninteractive
101101
102102# ## BEGIN install
103103
104+ REPO=" cloudfoundry/credhub-cli"
105+ ARCH=" amd64"
106+
104107# Soft version matching
105- find_version_from_git_tags VERSION " https://github.com/cloudfoundry/credhub-cli " " tags/"
108+ find_version_from_git_tags VERSION " https://github.com/$REPO " " tags/"
106109
107110check_packages curl ca-certificates
108111echo " Downloading credhub..."
109- curl -sL " https://github.com/cloudfoundry/credhub-cli/releases/download/${VERSION} /credhub-linux-${VERSION} .tgz" | tar -zxC " $TMPDIR "
112+
113+ # Try to download the release with the architecture type
114+ if curl -sL -o /dev/null -w " %{http_code}" " https://github.com/$REPO /releases/download/$VERSION /credhub-linux-$ARCH -$VERSION .tgz" | grep -q " 200" ; then
115+ curl -sL " https://github.com/$REPO /releases/download/$VERSION /credhub-linux-$ARCH -$VERSION .tgz" | tar -zxC " $TMPDIR "
116+ else
117+ # Fall back to the older naming convention
118+ curl -sL " https://github.com/$REPO /releases/download/$VERSION /credhub-linux-$VERSION .tgz" | tar -zxC " $TMPDIR "
119+ fi
120+
110121install " $TMPDIR /credhub" /usr/local/bin/credhub
111122credhub --version
112123
You can’t perform that action at this time.
0 commit comments