Files
setup-beam/dist/install-otp.ps1
T
Paulo F. Oliveira 2d314bc413 Check behaviour on Windows pre- Gleam 0.23 (#166)
* Check behaviour on Windows pre- Gleam 0.23

* Increase consistency with .sh counterpart

* Support older versions (pre 0.22.1) on Windows

* Increase inter-script consistency

* Run `npm run build-dist`

* React to CI results
2022-12-14 09:25:50 -06:00

21 lines
772 B
PowerShell

param([Parameter(Mandatory=$true)][string]${VSN})
$ErrorActionPreference="Stop"
Set-Location ${Env:RUNNER_TEMP}
$FILE_INPUT="otp_win64_${VSN}.exe"
$FILE_OUTPUT="otp.exe"
$DIR_FOR_BIN="${Env:RUNNER_TEMP}\.setup-beam\otp"
$ProgressPreference="SilentlyContinue"
Invoke-WebRequest "https://github.com/erlang/otp/releases/download/OTP-${VSN}/${FILE_INPUT}" -OutFile "${FILE_OUTPUT}"
$ProgressPreference="Continue"
New-Item "${DIR_FOR_BIN}" -ItemType Directory | Out-Null
$ProgressPreference="SilentlyContinue"
Start-Process "${FILE_OUTPUT}" "/S /D=${DIR_FOR_BIN}" -Wait
Write-Output "Installed Erlang/OTP version follows"
& "${DIR_FOR_BIN}/bin/erl.exe" "+V" | Write-Output
"INSTALL_DIR_FOR_OTP=${DIR_FOR_BIN}" | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append