oh-my-posh/packages/scoop/build.ps1

31 lines
942 B
PowerShell
Raw Normal View History

2020-10-27 04:10:22 -07:00
Param
(
2020-11-01 02:44:26 -08:00
[parameter(Mandatory = $true)]
2020-10-27 04:10:22 -07:00
[string]
$Version
2020-10-27 04:10:22 -07:00
)
function Get-HashForArchitecture {
param (
[parameter(Mandatory = $true)]
[string]
$Architecture,
[parameter(Mandatory = $true)]
[string]
$Version
)
$hash = (new-object Net.WebClient).DownloadString("https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$Version/install-$Architecture.exe.sha256")
return $hash.Trim()
}
2021-10-06 12:43:18 -07:00
New-Item -Path "." -Name "dist" -ItemType "directory"
$HashAmd64 = Get-HashForArchitecture -Architecture 'amd64' -Version $Version
$Hash386 = Get-HashForArchitecture -Architecture '386' -Version $Version
2021-10-06 12:43:18 -07:00
2020-11-01 04:35:34 -08:00
$content = Get-Content '.\oh-my-posh.json' -Raw
2020-10-27 04:10:22 -07:00
$content = $content.Replace('<VERSION>', $Version)
$content = $content.Replace('<HASH-AMD64>', $HashAmd64)
$content = $content.Replace('<HASH-386>', $Hash386)
2021-10-06 12:43:18 -07:00
$content | Out-File -Encoding 'UTF8' './dist/oh-my-posh.json'