Skip to content

Commit b92099f

Browse files
Fix issue with enableddelayedexpansion
1 parent c374b35 commit b92099f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

bin/elixir.bat

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@echo off
2-
SETLOCAL enabledelayedexpansion
32
set argc=0
43
for %%x in (%*) do set /A argc+=1
54
if %argc%== 0 (
@@ -51,7 +50,7 @@ set par=%1
5150
shift
5251
if "%par%"=="" (
5352
rem if no parameters defined
54-
goto :run
53+
goto :expand_erl_libs
5554
)
5655
rem ******* ERLANG PARAMETERS **********************
5756
IF NOT "%par%"=="%par:--detached=%" (Set parsErlang=%parsErlang% -detached)
@@ -72,6 +71,14 @@ IF NOT "%par%"=="%par:--remsh=%" (shift)
7271
goto:startloop
7372

7473
rem ******* assume all pre-params are parsed ********************
74+
:expand_erl_libs
75+
rem ******* expand all ebin paths as Windows does not support the ..\*\ebin wildcard ********************
76+
SETLOCAL enabledelayedexpansion
77+
set ext_libs=
78+
for /d %%d in ("%originPath%..\lib\*.") do (
79+
set ext_libs=!ext_libs! -pa "%%~fd\ebin"
80+
)
81+
SETLOCAL disabledelayedexpansion
7582
:run
76-
erl -env ERL_LIBS %ERL_LIBS%;"%originPath%\..\lib" -noshell %ELIXIR_ERL_OPTS% %parsErlang% -s elixir start_cli %beforeExtra% -extra %*
83+
erl %ext_libs% -noshell %ELIXIR_ERL_OPTS% %parsErlang% -s elixir start_cli %beforeExtra% -extra %*
7784

0 commit comments

Comments
 (0)