This commit is contained in:
parent
24b6739aa5
commit
73b20fd5e1
33
install.sh
33
install.sh
@ -18,6 +18,19 @@ function installCommands {
|
|||||||
fi
|
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
|
#start script
|
||||||
echo "Starting Golang install"
|
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"
|
echo "FATAL: No Go version found, set version input if no go.mod file is present"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
fixVersion
|
||||||
fi
|
fi
|
||||||
echo "Found go version: ${DL_VERSION_RAW}"
|
echo "Found go version: ${DL_VERSION_RAW}"
|
||||||
|
|
||||||
DL_ARCH=$GO_INSTALL_ARCH
|
DL_ARCH=$GO_INSTALL_ARCH
|
||||||
DL_VSPL=( $DL_VERSION_RAW )
|
# DL_VSPL=( $DL_VERSION_RAW )
|
||||||
DL_VERSION="${DL_VSPL[1]}"
|
# DL_VERSION="${DL_VSPL[1]}"
|
||||||
|
|
||||||
#ensure we have patch-level version, if not add 0 for stable releases
|
# #ensure we have patch-level version, if not add 0 for stable releases
|
||||||
# -P uses perl syntax
|
# # -P uses perl syntax
|
||||||
DL_VERSION_PAD_CHECK="$(grep "^go [0-9]+.[0-9]+.[0-9]+" go.mod -P)"
|
# DL_VERSION_PAD_CHECK="$(grep "^go [0-9]+.[0-9]+.[0-9]+" go.mod -P)"
|
||||||
if [[ -z "$DL_VERSION_PAD_CHECK" ]]; then
|
# if [[ -z "$DL_VERSION_PAD_CHECK" ]]; then
|
||||||
DL_VERSION="$DL_VERSION"".0"
|
# DL_VERSION="$DL_VERSION"".0"
|
||||||
echo "Fixing version number to ${DL_VERSION}"
|
# echo "Fixing version number to ${DL_VERSION}"
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
echo "Checking if go is already installed"
|
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
|
#check if go is already present before starting install process and delete files if purge input is set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user