@@ -46,36 +46,33 @@ function Download-Plugin {
4646function 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
6564if ($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}
7371else {
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
8078Install-Plugin - ArchiveDirectory $tmpDir - ArchiveName $archiveName - Destination (Join-Path $env: HELM_PLUGIN_DIR " bin" )
81-
0 commit comments