Skip to content

Commit b1495db

Browse files
committed
Pass -elixir_root as arg
1 parent 467dbb6 commit b1495db

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

bin/elixir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ fi
223223
ERTS_BIN=
224224
ERTS_BIN="$ERTS_BIN"
225225

226-
set -- "$ERTS_BIN$ERL_EXEC" -noshell -env ELIXIR_ROOT "$SCRIPT_PATH"/../lib -pa "$SCRIPT_PATH"/../lib/elixir/ebin $ELIXIR_ERL_OPTIONS -s elixir start_cli $ERL "$@"
226+
set -- "$ERTS_BIN$ERL_EXEC" -noshell -elixir_root "$SCRIPT_PATH"/../lib -pa "$SCRIPT_PATH"/../lib/elixir/ebin $ELIXIR_ERL_OPTIONS -s elixir start_cli $ERL "$@"
227227

228228
if [ -n "$RUN_ERL_PIPE" ]; then
229229
ESCAPED=""

lib/elixir/src/elixir.erl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ start(_Type, _Args) ->
3131
set_stdio_and_stderr_to_binary_and_maybe_utf8(),
3232
check_file_encoding(file:native_name_encoding()),
3333

34-
case os:getenv("ELIXIR_ROOT") of
35-
false ->
36-
ok;
37-
Root ->
34+
case init:get_argument(elixir_root) of
35+
{ok, [[Root]]} ->
3836
code:add_pathsa([
3937
Root ++ "/eex/ebin",
4038
Root ++ "/ex_unit/ebin",
4139
Root ++ "/iex/ebin",
4240
Root ++ "/logger/ebin",
4341
Root ++ "/mix/ebin",
4442
Root ++ "/elixir/ebin"
45-
])
43+
]);
44+
_ ->
45+
ok
4646
end,
4747

4848
case application:get_env(elixir, check_endianness, true) of
@@ -173,9 +173,9 @@ start_cli() ->
173173
elixir_config:booted().
174174

175175
start() ->
176-
case os:getenv("ELIXIR_ROOT") of
177-
false -> ok;
178-
Root -> code:add_patha(Root ++ "/iex/ebin")
176+
case init:get_argument(elixir_root) of
177+
{ok, [[Root]]} -> code:add_patha(Root ++ "/iex/ebin");
178+
_ -> ok
179179
end,
180180
'Elixir.IEx.CLI':main().
181181

lib/mix/lib/mix/tasks/release.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,7 @@ defmodule Mix.Tasks.Release do
14331433
&(&1
14341434
|> File.read!()
14351435
|> String.replace(
1436-
~s[ -env ELIXIR_ROOT "$SCRIPT_PATH"/../lib -pa "$SCRIPT_PATH"/../lib/elixir/ebin ],
1436+
~s[ -elixir_root "$SCRIPT_PATH"/../lib -pa "$SCRIPT_PATH"/../lib/elixir/ebin ],
14371437
" "
14381438
)
14391439
|> replace_erts_bin(release, ~s["$SCRIPT_PATH"/../../erts-#{release.erts_version}/bin/]))},
@@ -1447,7 +1447,7 @@ defmodule Mix.Tasks.Release do
14471447
&(&1
14481448
|> File.read!()
14491449
|> String.replace(
1450-
~s[ -env ELIXIR_ROOT !SCRIPT_PATH!..\\lib -pa !SCRIPT_PATH!..\\lib\\elixir\\ebin ],
1450+
~s[ -elixir_root !SCRIPT_PATH!..\\lib -pa !SCRIPT_PATH!..\\lib\\elixir\\ebin ],
14511451
" "
14521452
)
14531453
|> replace_erts_bin(release, ~s[%~dp0\\..\\..\\erts-#{release.erts_version}\\bin\\]))},

0 commit comments

Comments
 (0)