Skip to content

Commit

Permalink
Do not assume there is a $HOME, closes #13127
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Nov 20, 2023
1 parent 82a03f6 commit 84283f7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/iex/lib/iex/evaluator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,10 @@ defmodule IEx.Evaluator do
if path do
[path]
else
Enum.map([".", System.get_env("IEX_HOME", "~")], fn dir ->
dir |> Path.join(".iex.exs") |> Path.expand()
end)
# Do not assume there is a $HOME
for dir <- [".", System.get_env("IEX_HOME") || System.user_home()],
dir != nil,
do: dir |> Path.join(".iex.exs") |> Path.expand()
end

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

0 comments on commit 84283f7

Please sign in to comment.