From e27dc1cebbf8bbec3dc8d81e2ae16d79c9884895 Mon Sep 17 00:00:00 2001 From: ls-root Date: Sat, 7 Feb 2026 19:44:47 +0100 Subject: [PATCH] fix(setup): correctly auto-detect username when using --full (#11650) Argument parsing prevented auto-detection from running when --full was supplied without an explicit username. After shifting --full, no positional arguments remained, but the script had already skipped the auto-detection branch, leaving USERNAME empty and causing the script to abort. --- docs/contribution/setup-fork.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/contribution/setup-fork.sh b/docs/contribution/setup-fork.sh index 5ac54b90c..f3a1f4f47 100644 --- a/docs/contribution/setup-fork.sh +++ b/docs/contribution/setup-fork.sh @@ -237,7 +237,6 @@ if [[ $# -gt 0 ]]; then # Check for --full flag if [[ "$1" == "--full" ]]; then UPDATE_ALL=true - AUTO_DETECT=true shift # Remove --full from arguments fi @@ -250,8 +249,10 @@ if [[ $# -gt 0 ]]; then REPO_NAME="$2" fi fi -else - # Try auto-detection +fi + +# Try auto-detection +if [[ -z "$USERNAME" ]]; then if username=$(detect_username); then USERNAME="$username" print_success "Detected GitHub username: $USERNAME" @@ -261,14 +262,15 @@ else echo " ./setup-fork.sh YOUR_USERNAME" exit 1 fi +fi - if repo_name=$(detect_repo_name); then - REPO_NAME="$repo_name" - if [[ "$REPO_NAME" != "ProxmoxVE" ]]; then - print_info "Detected custom repo name: $REPO_NAME" - else - print_success "Using default repo name: ProxmoxVE" - fi +# Auto-detect repo name if needed +if repo_name=$(detect_repo_name); then + REPO_NAME="$repo_name" + if [[ "$REPO_NAME" != "ProxmoxVE" ]]; then + print_info "Detected custom repo name: $REPO_NAME" + else + print_success "Using default repo name: ProxmoxVE" fi fi