윈도우 lazygit 설치 시 오류 문제
This commit is contained in:
1 parent
174b543003
commit
27b0b4e6c9
1 file changed
+15
-9
+15
-9
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user