From 69a338610a7a1ba8cc5d57e6692b9c6380db64d7 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Mon, 2 Feb 2026 19:19:26 -0800 Subject: [PATCH] Enhance repository cloning logic in install script - Updated the install script to attempt cloning via SSH first for private repositories, falling back to HTTPS if the SSH method fails. - Added detailed error handling and user guidance for SSH key setup, improving the installation experience for users with private repositories. --- scripts/install.ps1 | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 0f97d497ec..9cecb4582b 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -148,7 +148,26 @@ function Install-Repository { exit 1 } } else { - git clone --branch $Branch $RepoUrl $InstallDir + # Try SSH first (for private repo access), fall back to HTTPS + Write-Info "Trying SSH clone..." + $sshResult = git clone --branch $Branch $RepoUrlSsh $InstallDir 2>&1 + + if ($LASTEXITCODE -eq 0) { + Write-Success "Cloned via SSH" + } else { + Write-Info "SSH failed, trying HTTPS..." + $httpsResult = git clone --branch $Branch $RepoUrlHttps $InstallDir 2>&1 + + if ($LASTEXITCODE -eq 0) { + Write-Success "Cloned via HTTPS" + } else { + Write-Error "Failed to clone repository" + Write-Info "For private repo access, ensure your SSH key is added to GitHub:" + Write-Info " ssh-add ~/.ssh/id_rsa" + Write-Info " ssh -T git@github.com # Test connection" + exit 1 + } + } } Write-Success "Repository ready"