Signed-off-by: Jeremy Adams <jeremy@dagger.io>
This commit is contained in:
Jeremy Adams 2024-12-22 09:31:44 -08:00
parent 566e23f6ed
commit 55c36bff52
No known key found for this signature in database
GPG key ID: EFAE55A5F386F0C2

View file

@ -62,15 +62,19 @@ runs:
# If the dagger version is 'latest', set the version back to an empty # If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest # string. This allows the install script to detect and install the latest
# version itself # version itself
# We remove any leading 'v' on VERSION here to ensure a match
VERSION=${{ inputs.version }} VERSION=${{ inputs.version }}
if [[ "$VERSION" == "latest" ]]; then if [[ "$VERSION" == "latest" ]]; then
VERSION= VERSION=
else
VERSION=$(echo -n $VERSION | cut -d' ' -f2 | cut -dv -f2 | tr -d '\n')
fi fi
COMMIT=${{ inputs.commit }} COMMIT=${{ inputs.commit }}
if [[ -x "$(command -v dagger)" ]]; then if [[ -x "$(command -v dagger)" ]]; then
pre_installed_version="$(dagger --silent version | cut --fields 2 --delimiter ' ')" # get dagger version without leading 'v' and always without newline
pre_installed_version="$(dagger --silent version | cut -d' ' -f2 | cut -dv -f2 | tr -d '\n')"
if [[ "$pre_installed_version" != "$VERSION" ]]; then if [[ "$pre_installed_version" != "$VERSION" ]]; then
echo "dagger ${pre_installed_version} is installed, but needed ${VERSION}" echo "dagger ${pre_installed_version} is installed, but needed ${VERSION}"
exit 1 exit 1