adjusting version fix
Some checks failed
test / test (push) Failing after 18s

This commit is contained in:
jake 2025-05-22 21:55:30 -04:00
parent 24b6739aa5
commit 73b20fd5e1

View File

@ -18,6 +18,19 @@ function installCommands {
fi
}
function fixVersion {
DL_VSPL=( $DL_VERSION_RAW )
DL_VERSION="${DL_VSPL[1]}"
#ensure we have patch-level version, if not add 0 for stable releases
# -P uses perl syntax
DL_VERSION_PAD_CHECK="$(grep "^go [0-9]+.[0-9]+.[0-9]+" go.mod -P)"
if [[ -z "$DL_VERSION_PAD_CHECK" ]]; then
DL_VERSION="$DL_VERSION"".0"
echo "Fixing version number to ${DL_VERSION}"
fi
}
#start script
echo "Starting Golang install"
@ -34,20 +47,22 @@ if [[ -z "$DL_VERSION_RAW" ]]; then
echo "FATAL: No Go version found, set version input if no go.mod file is present"
exit 1
fi
else
fixVersion
fi
echo "Found go version: ${DL_VERSION_RAW}"
DL_ARCH=$GO_INSTALL_ARCH
DL_VSPL=( $DL_VERSION_RAW )
DL_VERSION="${DL_VSPL[1]}"
# DL_VSPL=( $DL_VERSION_RAW )
# DL_VERSION="${DL_VSPL[1]}"
#ensure we have patch-level version, if not add 0 for stable releases
# -P uses perl syntax
DL_VERSION_PAD_CHECK="$(grep "^go [0-9]+.[0-9]+.[0-9]+" go.mod -P)"
if [[ -z "$DL_VERSION_PAD_CHECK" ]]; then
DL_VERSION="$DL_VERSION"".0"
echo "Fixing version number to ${DL_VERSION}"
fi
# #ensure we have patch-level version, if not add 0 for stable releases
# # -P uses perl syntax
# DL_VERSION_PAD_CHECK="$(grep "^go [0-9]+.[0-9]+.[0-9]+" go.mod -P)"
# if [[ -z "$DL_VERSION_PAD_CHECK" ]]; then
# DL_VERSION="$DL_VERSION"".0"
# echo "Fixing version number to ${DL_VERSION}"
# fi
echo "Checking if go is already installed"
#check if go is already present before starting install process and delete files if purge input is set