From 27b0b4e6c9fea36b26f3c9e835190dcebb2e0fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EB=AC=B8=EC=B0=BD=40MBA?= Date: Wed, 9 Sep 2026 13:05:15 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=88=EB=8F=84=EC=9A=B0=20lazygit=20?= =?UTF-8?q?=EC=84=A4=EC=B9=98=20=EC=8B=9C=20=EC=98=A4=EB=A5=98=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install-lazygit.ps1 | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/install-lazygit.ps1 b/install-lazygit.ps1 index 33d4d76..e8c6256 100644 --- a/install-lazygit.ps1 +++ b/install-lazygit.ps1 @@ -1,4 +1,4 @@ -#Requires -Version 5.1 +#Requires -Version 5.1 <# .SYNOPSIS Installs lazygit terminal UI for git from GitHub releases. @@ -98,25 +98,31 @@ function Install-GitPortable { } $tagName = $latestRelease.tag_name - # Git for Windows tags look like "v2.54.0.windows.1" - $gitVersion = $tagName -replace '^v', '' -replace '\.windows\.\d+$', '' - Write-Info "Latest Git for Windows: $tagName (version $gitVersion)" + Write-Info "Latest Git for Windows: $tagName" - # Find the PortableGit asset for our architecture - $portablePattern = "PortableGit-${gitVersion}-${gitArch}.7z.exe" - $asset = $latestRelease.assets | Where-Object { $_.name -eq $portablePattern } | Select-Object -First 1 + # Find the PortableGit asset for our architecture (e.g. PortableGit-2.55.0.5-64-bit.7z.exe) + $asset = $latestRelease.assets | Where-Object { + $_.name -match "^PortableGit-.*-${gitArch}\.7z\.exe$" + } | Select-Object -First 1 if (-not $asset) { - Write-Err "Could not find PortableGit asset matching '$portablePattern' in release $tagName." + $asset = $latestRelease.assets | Where-Object { + $_.name -like "PortableGit*$gitArch*.7z.exe" + } | Select-Object -First 1 } + if (-not $asset) { + Write-Err "Could not find PortableGit asset for architecture '$gitArch' in release $tagName." + } + + $assetName = $asset.name $downloadUrl = $asset.browser_download_url $installPath = Join-Path $env:USERPROFILE "PortableGit" # Download $tmpDir = Join-Path $env:TEMP "git_install_$(Get-Random)" New-Item -ItemType Directory -Path $tmpDir -Force | Out-Null - $zipPath = Join-Path $tmpDir "$portablePattern" + $zipPath = Join-Path $tmpDir "$assetName" try { Write-Info "Downloading: $downloadUrl"