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

31 lines
1.2 KiB
PowerShell
Raw Normal View History

2021-01-28 12:53:45 -08:00
Param
(
2021-09-14 09:13:33 -07:00
[parameter(Mandatory = $true)]
[ValidateSet('amd64', 'arm64')]
[System.String]$Architecture,
2021-01-28 12:53:45 -08:00
[parameter(Mandatory = $true)]
[string]
$Version
)
New-Item -Path "." -Name "bin" -ItemType Directory
Copy-Item -Path "../../themes" -Destination "./bin" -Recurse
# download the files and pack them
2021-09-14 09:13:33 -07:00
@{file = "posh-windows-$Architecture.exe"; name = "oh-my-posh.exe" }, @{file = "posh-linux-$Architecture"; name = "oh-my-posh-wsl" } | ForEach-Object -Process {
$download = "https://github.com/jandedobbeleer/oh-my-posh/releases/download/v$Version/$($_.file)"
2021-01-28 12:53:45 -08:00
Invoke-WebRequest $download -Out "./bin/$($_.name)"
}
2021-03-15 09:49:13 -07:00
# license
2021-02-15 23:36:37 -08:00
Invoke-WebRequest "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$Version/COPYING" -Out "./bin/COPYING.txt"
2021-01-28 12:53:45 -08:00
$content = Get-Content '.\oh-my-posh.iss' -Raw
$content = $content.Replace('<VERSION>', $Version)
2021-09-14 09:13:33 -07:00
$ISSName = ".oh-my-posh-$Architecture-$Version.iss"
$content | Out-File -Encoding 'UTF8' $ISSName
2021-01-28 12:53:45 -08:00
# package content
2021-09-14 09:13:33 -07:00
$installer = "install-$Architecture"
ISCC.exe /F$installer $ISSName
2021-01-28 12:53:45 -08:00
# get hash
2021-09-14 09:13:33 -07:00
$zipHash = Get-FileHash "Output/$installer.exe" -Algorithm SHA256
$zipHash.Hash | Out-File -Encoding 'UTF8' "Output/$installer.exe.sha256"