@@ -4,21 +4,17 @@ REM https://github.com/elixir-lang/elixir-lang.github.com/blob/main/install.bat
44
55setlocal EnableDelayedExpansion
66
7- set " otp_version = latest "
8- set " elixir_version = latest "
7+ set " otp_version = "
8+ set " elixir_version = "
99set " force = false"
1010
1111goto :main
1212
1313:usage
14- echo Usage: install.bat [arguments] [options]
14+ echo Usage: install.bat elixir@ELIXIR_VERSION otp@OTP_VERSION [options]
1515echo .
16- echo Arguments:
17- echo .
18- echo elixir@VERSION Install specific Elixir version. The version can be X.Y.Z, latest, or main
19- echo otp@VERSION Install specific Erlang/OTP version. The version can be X.Y.Z or latest
20- echo .
21- echo By default, elixir@latest and otp@latest are installed.
16+ echo ELIXIR_VERSION can be X.Y.Z, latest, or main.
17+ echo OTP_VERSION can be X.Y.Z or latest.
2218echo .
2319echo Options:
2420echo .
@@ -27,9 +23,9 @@ echo -h, --help Prints this help
2723echo .
2824echo Examples:
2925echo .
30- echo install.bat
3126echo install.bat elixir@1.16.3 otp@26.2.5.4
32- echo install.bat elixir@main
27+ echo install.bat elixir@latest otp@latest
28+ echo install.bat elixir@main otp@latest
3329echo .
3430goto :eof
3531
@@ -57,6 +53,18 @@ for %%i in (%*) do (
5753 )
5854)
5955
56+ if " %elixir_version% " == " " (
57+ call :usage
58+ echo error: missing elixir@VERSION argument
59+ exit /b 1
60+ )
61+
62+ if " %otp_version% " == " " (
63+ call :usage
64+ echo error: missing otp@VERSION argument
65+ exit /b 1
66+ )
67+
6068if " !otp_version! " == " latest" (
6169 set " url = https://github.com/erlef/otp_builds/releases/latest"
6270 for /f " tokens=2 delims= " %%a in ('curl -fsS --head " !url! " ^ | findstr /I " ^location:" ') do set url = %%a
0 commit comments