Skip to content

Commit cd2a59b

Browse files
committed
feat(prefix,setup): parameterise install-proton with version/latest + list-proton
- install_proton now accepts a version argument (default: latest) - "latest" queries GitHub API for newest GE-Proton tag - accepts full tag (GE-Proton10-1) or short form (10-1) - downloads to /tmp, extracts, cleans up - list_proton: fetches 10 most recent releases, marks installed version - router: install-proton passes $@ through; list-proton wired up - help text updated - hardcoded GE-Proton9-18 removed
1 parent 058314e commit cd2a59b

2 files changed

Lines changed: 58 additions & 14 deletions

File tree

lib/prefix.sh

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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).
435437
install_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
}

setup

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ WINE PREFIX MANAGEMENT:
3535
init --reinstall Force reinstall Wine apt packages (fixes broken wine)
3636
full [--reinstall] Complete setup: purge + init + install all
3737
quick [--reinstall] Reinit deps + install any missing launchers
38-
install-proton Download and install Proton-GE
38+
install-proton [ver] Download and install GE-Proton (default: latest)
39+
install-proton GE-Proton10-1 Install a specific version (short form: 10-1)
40+
list-proton List the 10 most recent GE-Proton releases
3941
fix-z-drive Permanently remove Z: drive mount
4042
unmount-z Temporarily hide Z: (stops /mnt disk warnings)
4143
mount-z Restore Z: drive
@@ -128,7 +130,8 @@ main() {
128130
init) shift; init "$@" ;;
129131
full) shift; full_setup "$@" ;;
130132
quick) shift; quick_setup "$@" ;;
131-
install-proton) install_proton ;;
133+
install-proton) shift; install_proton "$@" ;;
134+
list-proton) list_proton ;;
132135
fix-z-drive) fix_z_drive ;;
133136
unmount-z) unmount_z ;;
134137
mount-z) mount_z ;;

0 commit comments

Comments
 (0)