2 Commity

Autor SHA1 Zpráva Datum
9cf7b6d2b8 1.5.1 release 2025-04-13 13:35:01 -04:00
91cceec62f Fix download to stdout 2025-04-13 13:34:39 -04:00
2 změnil soubory, kde provedl 21 přidání a 2 odebrání

Zobrazit soubor

@@ -114,6 +114,10 @@ Multiple services (but not `--service-types`) can be installed at one time using
Install the latest version of MC from the best available repository. Install the latest version of MC from the best available repository.
* `installJRMC --mcversion 32 --debug`
Install the latest version of MC32 from the best available repository with debugging output.
* `installJRMC --install local --compat` * `installJRMC --install local --compat`
Install a more widely-compatible version of the latest MC (for older distros). Install a more widely-compatible version of the latest MC (for older distros).

Zobrazit soubor

@@ -18,7 +18,7 @@
# * Be careful with tabs in heredocs # * Be careful with tabs in heredocs
shopt -s extglob shopt -s extglob
declare -g SCRIPT_VERSION="1.5.1-dev" declare -g SCRIPT_VERSION="1.5.1"
declare -g MC_REPO="bullseye" # should match the MC_VERSION declare -g MC_REPO="bullseye" # should match the MC_VERSION
# declare -g MC_REPO="bookworm" # should match the MC_VERSION # declare -g MC_REPO="bookworm" # should match the MC_VERSION
declare -g MC_VERSION="33.0.72" # do find all replace declare -g MC_VERSION="33.0.72" # do find all replace
@@ -430,7 +430,7 @@ get_latest_mc_version() {
mc_version_source="containerized package manager" mc_version_source="containerized package manager"
execute buildah rm "$cnt" execute buildah rm "$cnt"
# Fallback to 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_stdout "$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"
# Fallback to hardcoded value # Fallback to hardcoded value
@@ -1802,6 +1802,21 @@ download() {
"${cmd[@]}" "$url" "${cmd[@]}" "$url"
} }
download_stdout() {
local url="$1"
local -a cmd
if command -v curl &>/dev/null; then
cmd=(curl --silent --fail --location -o - "$url")
elif command -v wget &>/dev/null; then
cmd=(wget --quiet -O - "$url")
else
err "Neither curl nor wget is available"
return 1
fi
"${cmd[@]}"
}
# Roughly turn debugging on for pre-init # Roughly turn debugging on for pre-init
# Reset and reparse in parse_input() with getopt # Reset and reparse in parse_input() with getopt