Skip to content

Commit

Permalink
Fix AU to Chocolatey-AU renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
strausmann committed Jun 10, 2024
1 parent 26250c9 commit 78164ae
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 17 deletions.
2 changes: 1 addition & 1 deletion _template/update.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import-module au
import-module Chocolatey-AU
. $PSScriptRoot\..\_scripts\all.ps1

$releases = ''
Expand Down
1 change: 1 addition & 0 deletions automatic/bambustudio/info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"0x8DC7AC5B6A78F93"|
26 changes: 24 additions & 2 deletions automatic/bambustudio/update.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
Import-Module AU
Import-Module Chocolatey-AU
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1"
Import-Module "../../scripts/au_extensions.psm1"

$release = Get-GitHubRelease bambulab BambuStudio

function GetResultInformation([string]$Url32) {
$fileName = Split-Path -Leaf $Url32
$dest = "$env:TEMP\$fileName"

Get-WebFile $Url32 $dest | Out-Null

$version = (Get-Command $dest).FileVersionInfo.ProductVersion
$ChecksumType = 'sha256'
$checksum32 = Get-FileHash $dest -Algorithm $checksumType | ForEach-Object Hash

Remove-Item $dest -Force -ErrorAction SilentlyContinue

@{
Url32 = $Url32
Version = $version
Checksum32 = $checksum32
ChecksumType32 = $ChecksumType
}
}

function global:au_GetLatest {
$Url32 = $release.assets | ? {$_.name -match 'Bambu_Studio_win_public' } | ? { $_.name.endswith('.exe') } | select -First 1 -ExpandProperty browser_download_url
$Url32 = $release.assets | Where-Object {$_.name -match 'Bambu_Studio_win_public' } | Where-Object { $_.name.endswith('.exe') } | Select-Object -First 1 -ExpandProperty browser_download_url

$version = $release.tag_name.Trim('v')
$ChecksumType = 'sha256'

$tag = $release.tag_name
$ReleaseNotes = "https://github.com/bambulab/BambuStudio/releases/tag/$($tag)"

Update-OnETagChanged -execUrl $Url32 -OnETagChanged { GetResultInformation $Url32 } -OnUpdated { @{ Url32 = $Url32 } }

@{
Url32 = $Url32
Version = $version
Expand Down
2 changes: 1 addition & 1 deletion automatic/logi-tune/update.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Import-Module AU
Import-Module Chocolatey-AU
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1"
Import-Module "../../scripts/au_extensions.psm1"
Expand Down
4 changes: 2 additions & 2 deletions automatic/orcaslicer/update.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Import-Module AU
Import-Module Chocolatey-AU
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1"
Import-Module "../../scripts/au_extensions.psm1"

$release = Get-GitHubRelease SoftFever OrcaSlicer

function global:au_GetLatest {
$Url32 = $release.assets | ? {$_.name -match 'Windows' } | ? { $_.name.endswith('_portable.zip') } | select -First 1 -ExpandProperty browser_download_url
$Url32 = $release.assets | ? {$_.name -match 'Windows' } | ? { $_.name.endswith('_portable.zip') } | Select-Object -First 1 -ExpandProperty browser_download_url

$version = $release.tag_name.Trim('v')
$ChecksumType = 'sha256'
Expand Down
10 changes: 5 additions & 5 deletions automatic/pkt/update.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Import-Module AU
Import-Module Chocolatey-AU
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1"
Import-Module "../../scripts/au_extensions.psm1"
Expand All @@ -10,16 +10,16 @@ function global:au_BeforeUpdate {
Get-RemoteFiles -Purge -NoSuffix
Set-Alias 7z $Env:chocolateyInstall\tools\7z.exe
7z e tools\*.zip -otools *.exe -r -y
rm tools\*.zip -ea 0
Remove-Item tools\*.zip -ea 0
}

function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing

$re = '\PktWorldWalletSetup.exe$'
$url = $download_page.links | ? href -match $re | select -First 1 -expand href
$domain = $releases -split '(?<=//.+)/' | select -First 1
$version = $url -split '[._-]|.exe' | select -Last 1 -Skip 2
$url = $download_page.links | ? href -match $re | Select-Object -First 1 -expand href
$domain = $releases -split '(?<=//.+)/' | Select-Object -First 1
$version = $url -split '[._-]|.exe' | Select-Object -Last 1 -Skip 2

@{
Version = $version
Expand Down
2 changes: 1 addition & 1 deletion automatic/qemu-guest-agent/update.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Import-Module AU
Import-Module Chocolatey-AU
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1"
Import-Module "../../scripts/au_extensions.psm1"
Expand Down
8 changes: 4 additions & 4 deletions automatic/speedtest-by-ookla/update.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Import-Module AU
Import-Module Chocolatey-AU
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1"
Import-Module "../../scripts/au_extensions.psm1"
Expand All @@ -8,11 +8,11 @@ $ChecksumType = 'sha256'

function global:au_GetLatest {
$web = Invoke-WebRequest $releases
$currentVersion = $web.AllElements | ?{$_.tagname -eq 'SPAN' -and $_.class -eq 'u-note'} | select -First 1 -Expand InnerText
$currentVersion = $web.AllElements | ?{$_.tagname -eq 'SPAN' -and $_.class -eq 'u-note'} | Select-Object -First 1 -Expand InnerText
$version = $currentVersion.TrimStart("v")

$req = Invoke-WebRequest -Uri $releases
$currentVersion = $req.AllElements | ?{$_.tagname -eq 'SPAN' -and $_.class -eq 'u-note'} | select -First 1 -Expand InnerText
$currentVersion = $req.AllElements | ?{$_.tagname -eq 'SPAN' -and $_.class -eq 'u-note'} | Select-Object -First 1 -Expand InnerText
$version = $currentVersion.TrimStart("v")

$Url32 = "https://install.speedtest.net/app/windows/$($version)/speedtestbyookla_x86.msi"
Expand Down Expand Up @@ -42,4 +42,4 @@ function global:au_AfterUpdate {
Set-DescriptionFromReadme -SkipFirst 2
}

Update-Package -ChecksumFor all -NoCheckChocoVersion $true
Update-Package -ChecksumFor all -NoCheckChocoVersion $true
2 changes: 1 addition & 1 deletion manual/sharegate-desktop/update.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Import-Module AU
Import-Module Chocolatey-AU
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1"
Import-Module "../../scripts/au_extensions.psm1"
Expand Down

0 comments on commit 78164ae

Please sign in to comment.