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

21 lines
593 B
PowerShell
Raw Normal View History

2020-10-27 04:10:22 -07:00
Param
(
[parameter(Mandatory=$true)]
[string]
$Version,
[parameter(Mandatory=$true)]
[string]
$LinuxSHA,
[parameter(Mandatory=$true)]
[string]
$WindowsSHA
)
$content = Get-Content '.\oh-my-posh.json' -Raw
$content = $content.Replace('<VERSION>', $Version)
$content = $content.Replace('<HASH_LINUX>', $LinuxSHA)
$content = $content.Replace('<HASH_WINDOWS>', $WindowsSHA)
$fileHash = Get-FileHash post-install.ps1 -Algorithm SHA256
$content = $content.Replace('<HASH_INSTALL_SCRIPT>', $fileHash.Hash)
$content | Out-File -Encoding 'UTF8' '.\oh-my-posh.json'