From 2beebf86ba8dbdb83c987b3a34ec57f802bad0f1 Mon Sep 17 00:00:00 2001 From: Mike Nguyen Date: Sat, 4 Jan 2025 21:15:38 +0000 Subject: [PATCH] Cleanup (#172) * chore: powershell lint fixes Signed-off-by: Mike Nguyen * chore: cleanup indentation Signed-off-by: Mike Nguyen --------- Signed-off-by: Mike Nguyen --- automatic/adobeair/update.ps1 | 1 - automatic/asana/update.ps1 | 1 - automatic/bootstrap-studio.install/update.ps1 | 2 +- automatic/clojure/update.ps1 | 2 +- automatic/hcloud.portable/update.ps1 | 6 ++++-- automatic/icue/update.ps1 | 7 +++++-- automatic/kakaotalk/tools/chocolateyUninstall.ps1 | 2 -- automatic/kakaotalk/update.ps1 | 6 ++++-- automatic/local/update.ps1 | 2 +- automatic/sparkmail/update.ps1 | 2 +- automatic/sqlite-studio.portable/update.ps1 | 6 ++++-- automatic/superantispyware/tools/chocolateyUninstall.ps1 | 3 --- automatic/superantispyware/update.ps1 | 6 ++++-- automatic/vultr-cli.portable/update.ps1 | 6 ++++-- 14 files changed, 29 insertions(+), 23 deletions(-) diff --git a/automatic/adobeair/update.ps1 b/automatic/adobeair/update.ps1 index 2e90eae1..956b9ac1 100644 --- a/automatic/adobeair/update.ps1 +++ b/automatic/adobeair/update.ps1 @@ -2,7 +2,6 @@ . $PSScriptRoot\..\..\scripts\all.ps1 -$releases = "https://airsdk.harman.com/runtime" $releaseBaseUrl = "https://airsdk.harman.com/assets/downloads/" function global:au_SearchReplace { diff --git a/automatic/asana/update.ps1 b/automatic/asana/update.ps1 index 55566620..35257432 100644 --- a/automatic/asana/update.ps1 +++ b/automatic/asana/update.ps1 @@ -4,7 +4,6 @@ $release32 = 'https://desktop-downloads.asana.com/win32_ia32/prod/latest/AsanaSetup.exe' $release64 = 'https://desktop-downloads.asana.com/win32_x64/prod/latest/AsanaSetup.exe' -$checksumType = 'SHA256' function global:au_SearchReplace { @{ diff --git a/automatic/bootstrap-studio.install/update.ps1 b/automatic/bootstrap-studio.install/update.ps1 index 672318b1..8a816294 100644 --- a/automatic/bootstrap-studio.install/update.ps1 +++ b/automatic/bootstrap-studio.install/update.ps1 @@ -29,7 +29,7 @@ function global:au_GetLatest { $matched = $page.Content -match $regexVersion - If ($False -ne $matchedurl) { + If ($False -ne $matched) { $url = -join("https://releases.bootstrapstudio.io/",$matches["version"],"/Bootstrap%20Studio%20-%20Setup.exe") $version = $matches["version"] } diff --git a/automatic/clojure/update.ps1 b/automatic/clojure/update.ps1 index 2bddfcdd..9ec8a915 100644 --- a/automatic/clojure/update.ps1 +++ b/automatic/clojure/update.ps1 @@ -32,7 +32,7 @@ function global:au_GetLatest { $matched = $page.Content -match $regexVersion - If ($False -ne $matchedurl) { + If ($False -ne $matched) { $url = -join("https://download.clojure.org/install/clojure-tools-",$matches["version"],".zip") $version = $matches["version"] } diff --git a/automatic/hcloud.portable/update.ps1 b/automatic/hcloud.portable/update.ps1 index fd322bcd..455b7a00 100644 --- a/automatic/hcloud.portable/update.ps1 +++ b/automatic/hcloud.portable/update.ps1 @@ -32,9 +32,11 @@ function global:au_GetLatest { $page = Invoke-WebRequest -Uri $releases -UseBasicParsing $regexUrl = 'hetznercloud\/cli\/releases\/tag\/v(?[\d\.]+)' - $match = $page.links | Where-Object href -match $regexUrl | Select-Object -First 1 -expand href + $matched = $page.links | Where-Object href -match $regexUrl | Select-Object -First 1 -expand href - $ver = $matches.version + If ($False -ne $matched) { + $ver = $matches.version + } return @{ URL32 = "https://github.com/hetznercloud/cli/releases/download/v$ver/hcloud-windows-386.zip" diff --git a/automatic/icue/update.ps1 b/automatic/icue/update.ps1 index 6f3247b9..80eb3f4e 100644 --- a/automatic/icue/update.ps1 +++ b/automatic/icue/update.ps1 @@ -32,12 +32,15 @@ function global:au_GetLatest { $matched = $page.Content -match $regexVersion + If ($False -ne $matched) { + $ver = $matches.version + } return @{ URL = $releaseUrl - Checksum = $checksum + Checksum = $checksum ChecksumType = $checksumType - Version = $matches.version + Version = $ver } } diff --git a/automatic/kakaotalk/tools/chocolateyUninstall.ps1 b/automatic/kakaotalk/tools/chocolateyUninstall.ps1 index c053322d..a7d5fa22 100644 --- a/automatic/kakaotalk/tools/chocolateyUninstall.ps1 +++ b/automatic/kakaotalk/tools/chocolateyUninstall.ps1 @@ -5,8 +5,6 @@ $softwareName = 'KakaoTalk*' $installerType = 'exe' $silentArgs = '/S' -$uninstalled = $false - [array]$key = Get-UninstallRegistryKey -SoftwareName $softwareName if ($key.Count -eq 1) { diff --git a/automatic/kakaotalk/update.ps1 b/automatic/kakaotalk/update.ps1 index 4b54aba2..dc817034 100644 --- a/automatic/kakaotalk/update.ps1 +++ b/automatic/kakaotalk/update.ps1 @@ -30,8 +30,10 @@ function global:au_GetLatest { $regexPage = '(?[\d]+\.[\d]+\.[\d]+\.[\d]+)' $matched = $page.Content -match $regexPage - - $version = $matches["version"] + + If ($False -ne $matched) { + $version = $matches["version"] + } return @{ URL = $release diff --git a/automatic/local/update.ps1 b/automatic/local/update.ps1 index 1a6d2d0b..a3eb4b04 100644 --- a/automatic/local/update.ps1 +++ b/automatic/local/update.ps1 @@ -2,7 +2,7 @@ . $PSScriptRoot\..\..\scripts\all.ps1 -$releases = 'https://localwp.com/releases/' +#$releases = 'https://localwp.com/releases/' go mod tidy diff --git a/automatic/sparkmail/update.ps1 b/automatic/sparkmail/update.ps1 index dbbb9d6e..8080ecaa 100644 --- a/automatic/sparkmail/update.ps1 +++ b/automatic/sparkmail/update.ps1 @@ -29,7 +29,7 @@ function global:au_GetLatest { $matched = $page.Content -match $regexVersion - If ($False -ne $matchedurl) { + If ($False -ne $matched) { $url = -join("https://downloads.sparkmailapp.com/Spark3/win/dist/",$matches["version"],"/Spark.exe") $version = $matches["version"] } diff --git a/automatic/sqlite-studio.portable/update.ps1 b/automatic/sqlite-studio.portable/update.ps1 index c26b9673..dbe79a4f 100644 --- a/automatic/sqlite-studio.portable/update.ps1 +++ b/automatic/sqlite-studio.portable/update.ps1 @@ -32,9 +32,11 @@ function global:au_GetLatest { $page = Invoke-WebRequest -Uri $releases -UseBasicParsing $regexUrl = 'pawelsalawa\/sqlitestudio\/releases\/tag\/(?[\d\.]+)' - $match = $page.links | Where-Object href -match $regexUrl | Select-Object -First 1 -expand href + $matched = $page.links | Where-Object href -match $regexUrl | Select-Object -First 1 -expand href - $ver = $matches.version + If ($False -ne $matched) { + $ver = $matches.version + } return @{ URL32 = "https://github.com/pawelsalawa/sqlitestudio/releases/download/$ver/sqlitestudio_i386-$ver.zip" diff --git a/automatic/superantispyware/tools/chocolateyUninstall.ps1 b/automatic/superantispyware/tools/chocolateyUninstall.ps1 index 12e7d49d..db7af2e6 100644 --- a/automatic/superantispyware/tools/chocolateyUninstall.ps1 +++ b/automatic/superantispyware/tools/chocolateyUninstall.ps1 @@ -1,9 +1,6 @@ $packageName = $env:ChocolateyPackageName $installerType = 'EXE' $silentArgs = '/noui /clean' -$validExitCodes = @(0) -$path = "$env:ProgramFiles\SUPERAntiSpyware" -$path86 = "${env:ProgramFiles(x86)}\SUPERAntiSpyware" $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $url = 'https://www.superantispyware.com/downloads/SASUNINST.EXE' $checksum = '0bc49dea91079a174f674e7ea9a2e5c953ee78498421d9d2f8ecc7f5d986545d' diff --git a/automatic/superantispyware/update.ps1 b/automatic/superantispyware/update.ps1 index 778f8557..5958d28e 100644 --- a/automatic/superantispyware/update.ps1 +++ b/automatic/superantispyware/update.ps1 @@ -40,8 +40,10 @@ function global:au_GetLatest { $matched = $page.Content -match $regexPage - $version = $matches["version"] - + If ($False -ne $matched) { + $version = $matches["version"] + } + $url = "https://securedownloads.superantispyware.com/SUPERAntiSpyware.exe" return @{ diff --git a/automatic/vultr-cli.portable/update.ps1 b/automatic/vultr-cli.portable/update.ps1 index ec3ec9f2..e5a18583 100644 --- a/automatic/vultr-cli.portable/update.ps1 +++ b/automatic/vultr-cli.portable/update.ps1 @@ -27,9 +27,11 @@ function global:au_GetLatest { $page = Invoke-WebRequest -Uri $releases -UseBasicParsing $regexUrl = 'vultr\/vultr-cli\/releases\/tag\/v(?[\d\.]+)' - $url64 = $page.links | Where-Object href -match $regexUrl | Select-Object -First 1 -expand href + $matched = $page.links | Where-Object href -match $regexUrl | Select-Object -First 1 -expand href - $ver = $matches.version + If ($False -ne $matched) { + $ver = $matches.version + } return @{ URL64 = "https://github.com/vultr/vultr-cli/releases/download/v$ver/vultr-cli_v"+$ver+"_windows_amd64.zip"