Skip to content

Commit

Permalink
Task: Add Abacus.AbaClient
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecterShell committed Jan 13, 2025
1 parent 36934b6 commit 53a7346
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tasks/Abacus.AbaClient/Config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Type: PackageTask
WinGetIdentifier: Abacus.AbaClient
Skip: false
68 changes: 68 additions & 0 deletions Tasks/Abacus.AbaClient/Script.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
$Object1 = Invoke-RestMethod -Uri 'https://abaclient-prod.app.abasky.net/release/currentVersion.json'

# Version
$this.CurrentState.Version = $Object1.version

# Installer
$this.CurrentState.Installer += [ordered]@{
InstallerLocale = 'en'
InstallerUrl = $Object1.msi_en
}
$this.CurrentState.Installer += [ordered]@{
InstallerLocale = 'de'
InstallerUrl = $Object1.msi_de
}
$this.CurrentState.Installer += [ordered]@{
InstallerLocale = 'fr'
InstallerUrl = $Object1.msi_fr
}
$this.CurrentState.Installer += [ordered]@{
InstallerLocale = 'it'
InstallerUrl = $Object1.msi_it
}

switch -Regex ($this.Check()) {
'New|Changed|Updated' {
try {
# ReleaseNotes (en-US)
$this.CurrentState.Locale += [ordered]@{
Locale = 'en-US'
Key = 'ReleaseNotes'
Value = $Object1.releaseNotes.en | Format-Text
}

# ReleaseNotes (de-DE)
$this.CurrentState.Locale += [ordered]@{
Locale = 'de-DE'
Key = 'ReleaseNotes'
Value = $Object1.releaseNotes.de | Format-Text
}

# ReleaseNotes (fr-FR)
$this.CurrentState.Locale += [ordered]@{
Locale = 'fr-FR'
Key = 'ReleaseNotes'
Value = $Object1.releaseNotes.fr | Format-Text
}

# ReleaseNotes (it-IT)
$this.CurrentState.Locale += [ordered]@{
Locale = 'it-IT'
Key = 'ReleaseNotes'
Value = $Object1.releaseNotes.it | Format-Text
}
} catch {
$_ | Out-Host
$this.Log($_, 'Warning')
}

$this.Print()
$this.Write()
}
'Changed|Updated' {
$this.Message()
}
'Updated' {
$this.Submit()
}
}

0 comments on commit 53a7346

Please sign in to comment.