Skip to content

Commit 8a77e87

Browse files
author
José Valim
committed
Fix bug when running mix on directories containig space, closes #840
1 parent a19a4b8 commit 8a77e87

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

bin/elixir.bat

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
@echo off
2-
if "%*" == "" (
3-
goto documentation
2+
set argc=0
3+
for %%x in (%*) do set /A argc+=1
4+
if %argc% == 0 (
5+
goto documentation
46
) else (
5-
goto run
6-
)
7+
goto run
8+
)
79
:documentation
810
echo Usage: %~nx0 [options] [.exs file] [data]
911
echo.
@@ -20,4 +22,4 @@ echo ** Options marked with (*) can be given more than once
2022
echo ** Options given after the .exs file or -- are passed down to the executed code
2123
echo ** Options can be passed to the erlang runtime using ELIXIR_ERL_OPTS
2224
:run
23-
erl -env ERL_LIBS %ERL_LIBS%;"%~dp0\..\lib" -noshell %ELIXIR_ERL_OPTS% -s elixir start_cli -extra %*
25+
erl -env ERL_LIBS %ERL_LIBS%;"%~dp0\..\lib" -noshell %ELIXIR_ERL_OPTS% -s elixir start_cli -extra %*

bin/elixirc.bat

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
@echo off
2-
if "%*" == "" (
3-
goto documentation
2+
set argc=0
3+
for %%x in (%*) do set /A argc+=1
4+
if %argc% == 0 (
5+
goto documentation
46
) else (
5-
goto run
6-
)
7+
goto run
8+
)
79
:documentation
810
echo Usage: %~nx0 [elixir switches] [compiler switches] [.ex files]
911
echo.
@@ -16,4 +18,4 @@ echo ** Options marked with (*) can be given more than once
1618
echo ** Options given after -- are passed down to the executed code
1719
echo ** Options can be passed to the erlang runtime using ELIXIR_ERL_OPTS" >&2
1820
:run
19-
call "%~dp0\elixir.bat" --compile %*
21+
call "%~dp0\elixir.bat" --compile %*

bin/mix.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
call "%~dp0\elixir.bat" "%~dp0\mix" %*
1+
@echo off
2+
call "%~dp0\elixir.bat" "%~dp0\mix" %*

0 commit comments

Comments
 (0)