Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bin/elixir
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,13 @@ while [ $I -ge 0 ]; do
I=$((I - 1))
done

SELF=$(readlink_f "$0")
SCRIPT_PATH=$(dirname "$SELF")
# Use $0 directly when it is an absolute path that is not a symbolic link
if [ "${0#/}" != "$0" ] && [ ! -h "$0" ]; then
SELF="$0"
else
SELF=$(readlink_f "$0")
fi
SCRIPT_PATH="${SELF%/*}"

if [ "$OSTYPE" = "cygwin" ]; then SCRIPT_PATH=$(cygpath -m "$SCRIPT_PATH"); fi
if [ "$MODE" != "iex" ]; then ERL="-s elixir start_cli $ERL"; fi
Expand Down
2 changes: 1 addition & 1 deletion lib/elixir/lib/module/types/of.ex
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ defmodule Module.Types.Of do
def modules(type, fun, arity, hints \\ [], expr, meta, stack, context) do
case atom_fetch(type) do
{:finite, mods} ->
{mods, context}
{:lists.sort(mods), context}

{:infinite, _} ->
{[], context}
Expand Down
16 changes: 16 additions & 0 deletions lib/elixir/src/elixir.erl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
-include("elixir.hrl").
-define(system, 'Elixir.System').
-define(elixir_eval_env, {elixir, eval_env}).
-define(cli_modules, [
'Elixir.Access', 'Elixir.Application', 'Elixir.Code', 'Elixir.Enum', 'Elixir.IO',
'Elixir.Kernel', 'Elixir.Kernel.CLI', 'Elixir.Keyword', 'Elixir.List.Chars',
'Elixir.List.Chars.List', 'Elixir.Macro.Env', 'Elixir.Map', 'Elixir.Module.ParallelChecker',
'Elixir.Regex', 'Elixir.String.Chars', 'Elixir.String.Tokenizer', 'Elixir.Supervisor',
'Elixir.Supervisor.Default', 'Elixir.System', elixir_aliases, elixir_bitstring,
elixir_code_server, elixir_config, elixir_dispatch, elixir_env, elixir_erl, elixir_erl_pass,
elixir_erl_var, elixir_expand, elixir_interpolation, elixir_module, elixir_parser,
elixir_quote, elixir_rewrite, elixir_sup, elixir_tokenizer, elixir_utils,
erl_bits, eval_bits, logger_backend, re
]).
-define(cli_logger_modules, [
'Elixir.Logger', 'Elixir.Logger.App', 'Elixir.Logger.Formatter', 'Elixir.Logger.Utils'
]).

%% Top level types
%% TODO: Remove char_list type on v2.0
Expand Down Expand Up @@ -180,7 +194,9 @@ start() ->
user_drv:start(#{initial_shell => iex:shell()}).

start_cli() ->
_ = code:ensure_modules_loaded(?cli_modules),
{ok, _} = application:ensure_all_started(elixir),
_ = code:ensure_modules_loaded(?cli_logger_modules),

%% We start the Logger so tools that depend on Elixir
%% always have the Logger directly accessible. However
Expand Down
Loading