Skip to content

Commit

Permalink
Merge pull request #1668 from SayakMukhopadhyay/master
Browse files Browse the repository at this point in the history
(k9s) Updated K9s update script to reflect changes to asset rename
  • Loading branch information
pauby authored Jun 25, 2021
2 parents af9c149 + 508d1f3 commit 1a4c658
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions automatic/k9s/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

$packageArgs = @{
PackageName = $packageName
FileFullPath64 = Get-Item $toolsDir\k9s_Windows_x86_64.tar.gz
FileFullPath64 = Get-Item $toolsDir\k9s_*_Windows_x86_64.tar.gz
Destination = $toolsDir
}

Get-ChocolateyUnzip @packageArgs

$packageArgs2 = @{
PackageName = $packageName
FileFullPath64 = Get-Item $toolsDir\k9s_Windows_x86_64.tar
FileFullPath64 = Get-Item $toolsDir\k9s_*_Windows_x86_64.tar
Destination = $toolsDir
}

Get-ChocolateyUnzip @packageArgs2

Remove-Item "$toolsDir\k9s_Windows_*.tar"
Remove-Item "$toolsDir\k9s_*_Windows_*.tar"
9 changes: 4 additions & 5 deletions automatic/k9s/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ param([switch] $Force)

Import-Module AU

$domain = 'https://github.com'
$domain = 'https://github.com'
$releases = "$domain/derailed/k9s/releases/latest"

$filename64 = 'k9s_Windows_x86_64.tar.gz'

function global:au_BeforeUpdate {
Get-RemoteFiles -Purge -NoSuffix
}
Expand Down Expand Up @@ -36,8 +34,9 @@ function global:au_GetLatest {

$checksumAsset = $domain + ($download_page.Links | ? href -match "checksums\.txt$" | select -first 1 -expand href)
$checksum_page = Invoke-WebRequest -Uri $checksumAsset -UseBasicParsing
$filename64 = -join('k9s_v', $version, '_Windows_x86_64.tar.gz')
$checksum64 = [regex]::Match($checksum_page, "([a-f\d]+)\s*$([regex]::Escape($filename64))").Groups[1].Value

return @{
Version = $version
URL64 = "$domain/derailed/k9s/releases/download/v${version}/${filename64}"
Expand All @@ -48,4 +47,4 @@ function global:au_GetLatest {
}
}

update -ChecksumFor none -Force:$Force
update -ChecksumFor none -Force:$Force

0 comments on commit 1a4c658

Please sign in to comment.