Skip to content

Commit 77f3dcc

Browse files
moving git version check to online install only
1 parent 09b4759 commit 77f3dcc

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

install-binary.ps1

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,36 +46,33 @@ function Download-Plugin {
4646
function Install-Plugin {
4747
param ([Parameter(Mandatory=$true)][string] $ArchiveDirectory, [Parameter(Mandatory=$true)][string] $ArchiveName, [Parameter(Mandatory=$true)][string] $Destination)
4848
Push-Location $ArchiveDirectory
49-
tar -xzf $ArchiveName -C .
49+
tar -xzf $ArchiveName -C .
5050
Pop-Location
5151
New-Item -ItemType Directory -Path $Destination -Force
5252
Copy-Item -Path (Join-Path $ArchiveDirectory "diff" "bin" "diff.exe") -Destination $Destination -Force
5353
}
5454

5555
$ErrorActionPreference = "Stop"
56+
5657
$archiveName = "helm-diff.tgz"
5758
$arch = Get-Architecture
58-
$version = Get-Version -Update $Update
5959
$tmpDir = New-TemporaryDirectory
60-
trap { Remove-Item -path $tmpDir -Recurse -Force }
61-
60+
trap { Remove-Item -path $tmpDir -Recurse -Force }
6261
$output = Join-Path $tmpDir $archiveName
6362

6463
# Check for offline installation via environment variable
6564
if ($env:HELM_DIFF_BIN_TGZ) {
6665
Write-Host "HELM_DIFF_BIN_TGZ is set. Using local package at: $($env:HELM_DIFF_BIN_TGZ)"
67-
6866
if (-not (Test-Path $env:HELM_DIFF_BIN_TGZ -PathType Leaf)) {
6967
throw "Offline installation failed: File not found at '$($env:HELM_DIFF_BIN_TGZ)'"
7068
}
7169
Copy-Item -Path $env:HELM_DIFF_BIN_TGZ -Destination $output
7270
}
7371
else {
7472
# Proceed with online installation
75-
Write-Host "HELM_DIFF_BIN_TGZ not set. Proceeding with online installation."
73+
$version = Get-Version -Update $Update
7674
$url = Get-Url -Version $version -Architecture $arch
7775
Download-Plugin -Url $url -Output $output
7876
}
7977

8078
Install-Plugin -ArchiveDirectory $tmpDir -ArchiveName $archiveName -Destination (Join-Path $env:HELM_PLUGIN_DIR "bin")
81-

0 commit comments

Comments
 (0)