new/version-input #3

Merged
jake merged 11 commits from new/version-input into main 2026-05-27 18:55:06 +00:00
Showing only changes of commit 73b20fd5e1 - Show all commits

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