mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-26 04:10:39 +00:00
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.
This commit is contained in:
@@ -237,7 +237,6 @@ if [[ $# -gt 0 ]]; then
|
|||||||
# Check for --full flag
|
# Check for --full flag
|
||||||
if [[ "$1" == "--full" ]]; then
|
if [[ "$1" == "--full" ]]; then
|
||||||
UPDATE_ALL=true
|
UPDATE_ALL=true
|
||||||
AUTO_DETECT=true
|
|
||||||
shift # Remove --full from arguments
|
shift # Remove --full from arguments
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -250,8 +249,10 @@ if [[ $# -gt 0 ]]; then
|
|||||||
REPO_NAME="$2"
|
REPO_NAME="$2"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
fi
|
||||||
# Try auto-detection
|
|
||||||
|
# Try auto-detection
|
||||||
|
if [[ -z "$USERNAME" ]]; then
|
||||||
if username=$(detect_username); then
|
if username=$(detect_username); then
|
||||||
USERNAME="$username"
|
USERNAME="$username"
|
||||||
print_success "Detected GitHub username: $USERNAME"
|
print_success "Detected GitHub username: $USERNAME"
|
||||||
@@ -261,14 +262,15 @@ else
|
|||||||
echo " ./setup-fork.sh YOUR_USERNAME"
|
echo " ./setup-fork.sh YOUR_USERNAME"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if repo_name=$(detect_repo_name); then
|
# Auto-detect repo name if needed
|
||||||
REPO_NAME="$repo_name"
|
if repo_name=$(detect_repo_name); then
|
||||||
if [[ "$REPO_NAME" != "ProxmoxVE" ]]; then
|
REPO_NAME="$repo_name"
|
||||||
print_info "Detected custom repo name: $REPO_NAME"
|
if [[ "$REPO_NAME" != "ProxmoxVE" ]]; then
|
||||||
else
|
print_info "Detected custom repo name: $REPO_NAME"
|
||||||
print_success "Using default repo name: ProxmoxVE"
|
else
|
||||||
fi
|
print_success "Using default repo name: ProxmoxVE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user