mirror of
https://github.com/erlef/setup-beam.git
synced 2026-07-31 12:10:48 +00:00
Install OTP on Windows to a local directory (#139)
This commit is contained in:
+4
-9
@@ -5,18 +5,13 @@ $ErrorActionPreference="Stop"
|
||||
Set-Location ${Env:RUNNER_TEMP}
|
||||
|
||||
$FILE_OUTPUT="otp.exe"
|
||||
$DIR_FOR_BIN=".setup-beam/otp"
|
||||
$ERL_ROOT = "${Env:RUNNER_TEMP}\.setup-beam\otp"
|
||||
|
||||
$ProgressPreference="SilentlyContinue"
|
||||
Invoke-WebRequest "https://github.com/erlang/otp/releases/download/OTP-${VSN}/otp_win64_${VSN}.exe" -OutFile "${FILE_OUTPUT}"
|
||||
$ProgressPreference="Continue"
|
||||
New-Item "${DIR_FOR_BIN}" -ItemType Directory | Out-Null
|
||||
Move-Item "${FILE_OUTPUT}" "${DIR_FOR_BIN}"
|
||||
Start-Process "./${DIR_FOR_BIN}/${FILE_OUTPUT}" /S -Wait
|
||||
$ErlExec = Get-ChildItem -Path "C:/Program Files/" -Recurse -Depth 2 -Filter 'erl.exe' -Name | ForEach-Object { Write-Output "C:/Program Files/$_" }
|
||||
$ErlPath = Split-Path -Path "${ErlExec}"
|
||||
Write-Output "${ErlPath}" | Out-File -FilePath otp_path.txt -Encoding utf8 -NoNewline
|
||||
Start-Process "${FILE_OUTPUT}" "/S /D=${ERL_ROOT}" -Wait
|
||||
Write-Output "Installed Erlang/OTP version follows"
|
||||
& "${ErlPath}/erl.exe" "+V" | Write-Output
|
||||
& "${ERL_ROOT}/bin/erl.exe" "+V" | Write-Output
|
||||
|
||||
"INSTALL_DIR_FOR_OTP="+(Get-Item ${ErlPath}).parent.FullName | Out-File -FilePath ${Env:GITHUB_ENV} -Encoding utf8 -Append
|
||||
"INSTALL_DIR_FOR_OTP=" + ${ERL_ROOT}
|
||||
|
||||
Reference in New Issue
Block a user