Skip to content

Commit b96211a

Browse files
committed
Do not assume there is a $HOME, closes #13127
1 parent 17b9ba6 commit b96211a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/iex/lib/iex/evaluator.ex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,10 @@ defmodule IEx.Evaluator do
253253
if path do
254254
[path]
255255
else
256-
Enum.map([".", System.get_env("IEX_HOME", "~")], fn dir ->
257-
dir |> Path.join(".iex.exs") |> Path.expand()
258-
end)
256+
# Do not assume there is a $HOME
257+
for dir <- [".", System.get_env("IEX_HOME") || System.user_home()],
258+
dir != nil,
259+
do: dir |> Path.join(".iex.exs") |> Path.expand()
259260
end
260261

261262
path = Enum.find(candidates, &File.regular?/1)

0 commit comments

Comments
 (0)