Formatting

This commit is contained in:
2024-11-04 14:01:11 -05:00
parent f53e883b96
commit 711ee5621a

View File

@@ -322,6 +322,7 @@ init() {
esac esac
fi fi
# Set distro-specific package manager commands for normalized IDs
case $ID in case $ID in
fedora|centos) fedora|centos)
local rpm_mgr local rpm_mgr
@@ -388,11 +389,8 @@ init() {
esac esac
fi fi
debug "Using host platform: $ID $VERSION_ID" debug "Host platform: $ID $VERSION_ID"
debug "Using MC repository: $MC_REPO" debug "MC repository: $MC_REPO"
# Set distro-specific package manager commands for normalized IDs
} }
# @description Determines the latest JRiver MC version using several methods # @description Determines the latest JRiver MC version using several methods
@@ -401,7 +399,8 @@ get_latest_mc_version() {
debug "Running: ${FUNCNAME[0]}" "$*" debug "Running: ${FUNCNAME[0]}" "$*"
local cnt mc_version_source local cnt mc_version_source
if install_package buildah \ # Use generalized containerized package manager to determine latest MC version
if install_package --silent buildah \
&& cnt=$(buildah from --quiet alpine:edge 2>/dev/null) \ && cnt=$(buildah from --quiet alpine:edge 2>/dev/null) \
&& buildah run "$cnt" -- sh -c \ && buildah run "$cnt" -- sh -c \
"apk add apt" &>/dev/null \ "apk add apt" &>/dev/null \
@@ -413,11 +412,11 @@ get_latest_mc_version() {
&& [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then && [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then
mc_version_source="containerized package manager" mc_version_source="containerized package manager"
execute buildah rm "$cnt" execute buildah rm "$cnt"
# Webscrape # Fallback to webscrape
elif MC_VERSION=$(download "$BOARD_URL" | grep -o "[0-9][0-9]\.[0-9]\.[0-9]\+" | head -n 1) \ elif MC_VERSION=$(download "$BOARD_URL" | grep -o "[0-9][0-9]\.[0-9]\.[0-9]\+" | head -n 1) \
&& [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then && [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then
mc_version_source="webscrape" mc_version_source="webscrape"
# Hardcoded # Fallback to hardcoded value
else else
mc_version_source="hardcoded" mc_version_source="hardcoded"
err "Warning! Using hardcoded version number" err "Warning! Using hardcoded version number"