CMake/.gitlab/ci/orangec.ps1
Brad King 7f9817b7cb Remove unnecessary executable permission from .ps1 scripts
Powershell scripts cannot be launched as commands on Windows.
They must be run through the `powershell` or `pwsh` tool.
2024-04-30 09:33:44 -04:00

25 lines
918 B
PowerShell

$erroractionpreference = "stop"
if ("$env:CMAKE_CONFIGURATION".Contains("orangec6.73.1")) {
# OrangeC 6.73.1
$archive = "ZippedBinaries6738.zip"
$release = "Orange-C-v6.73.1"
$sha256sum = "29BC506AB105B2BF1002129C37826B2153DF1C8D0F22B9A2C38ACA3FB72A5B89"
} else {
throw ('unknown CMAKE_CONFIGURATION: ' + "$env:CMAKE_CONFIGURATION")
}
$outdir = $pwd.Path
$outdir = "$outdir\.gitlab"
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/LADSoft/OrangeC/releases/download/$release/$archive" -OutFile "$outdir\$archive"
$hash = Get-FileHash "$outdir\$archive" -Algorithm SHA256
if ($hash.Hash -ne $sha256sum) {
exit 1
}
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$archive", "$outdir")
# The archive contains directory 'orangec', placed at '$outdir\orangec'.
Remove-Item "$outdir\$archive"