@@ -432,26 +432,67 @@ suppress_z_warnings() {
432432}
433433
434434# Download and install Proton-GE.
435+ # Usage: install_proton [version|latest] (default: latest)
436+ # Accepts full tag (GE-Proton10-1) or short form (10-1).
435437install_proton () {
436- print_info " Installing Proton-GE..."
438+ local version=" ${1:- latest} "
439+
440+ if [ " $version " = " latest" ]; then
441+ print_info " Fetching latest GE-Proton release from GitHub..."
442+ version=$( curl -sf \
443+ " https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest" \
444+ | grep -oP ' "tag_name":\s*"\K[^"]+' | head -1)
445+ if [ -z " $version " ]; then
446+ print_error " Failed to resolve latest version — specify one explicitly:"
447+ print_info " wig install-proton GE-Proton10-1"
448+ print_info " wig list-proton"
449+ return 1
450+ fi
451+ print_info " Latest release: $version "
452+ fi
437453
438- mkdir -p " $PROTON_DIR "
439- cd /tmp
454+ # Accept short form like 10-1 → GE-Proton10-1
455+ [[ " $version " =~ ^[0-9] ]] && version=" GE-Proton${version} "
456+
457+ print_info " Installing Proton-GE $version ..."
440458
441- local PROTON_VERSION= " GE-Proton9-18 "
442- local archive= " ${PROTON_VERSION} .tar.gz "
459+ local archive= " ${version} .tar.gz "
460+ local url= " https://github.com/GloriousEggroll/proton-ge-custom/releases/download/ ${version} / ${archive} "
443461
444- print_info " Downloading Proton-GE $PROTON_VERSION ... "
462+ mkdir -p " $PROTON_DIR "
445463
446- if ! wget -q --show-progress \
447- " https://github.com/GloriousEggroll/proton-ge-custom/releases/download/${PROTON_VERSION} /${archive} " ; then
448- print_error " Failed to download Proton-GE"
464+ print_info " Downloading Proton-GE ${version} ..."
465+ if ! wget -q --show-progress -O " /tmp/${archive} " " $url " ; then
466+ print_error " Download failed for $version "
467+ print_info " Browse releases: https://github.com/GloriousEggroll/proton-ge-custom/releases"
468+ rm -f " /tmp/${archive} "
449469 return 1
450470 fi
451471
452472 print_info " Extracting Proton-GE..."
453- run_without_oas tar -xf " $ archive" -C " $PROTON_DIR " --strip-components=1
454- rm -f " $ archive"
473+ run_without_oas tar -xf " /tmp/ ${ archive} " -C " $PROTON_DIR " --strip-components=1
474+ rm -f " /tmp/ ${ archive} "
455475
456- print_success " Proton-GE installed to $PROTON_DIR "
476+ print_success " Proton-GE ${version} installed to $PROTON_DIR "
477+ }
478+
479+ # Show the 10 most recent GE-Proton release tags from GitHub.
480+ list_proton () {
481+ print_info " Fetching GE-Proton release list..."
482+ local tags
483+ tags=$( curl -sf \
484+ " https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases?per_page=10" \
485+ | grep -oP ' "tag_name":\s*"\K[^"]+' | head -10)
486+ if [ -z " $tags " ]; then
487+ print_error " Could not fetch release list (network or rate-limit issue)"
488+ print_info " Browse manually: https://github.com/GloriousEggroll/proton-ge-custom/releases"
489+ return 1
490+ fi
491+ echo " │ Available GE-Proton releases (newest first):"
492+ echo " $tags " | while IFS= read -r tag; do
493+ local current_marker=" "
494+ [ -f " $PROTON_DIR /version" ] && grep -q " $tag " " $PROTON_DIR /version" 2> /dev/null && current_marker=" ← installed"
495+ echo " $tag ${current_marker} "
496+ done
497+ echo " │ Install: wig install-proton <version> | wig install-proton latest"
457498}
0 commit comments