File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1080,15 +1080,17 @@ defmodule IEx.Helpers do
10801080 { :error , :enoent } ->
10811081 IO . puts ( IEx . color ( :eval_error , "No such file or directory #{ path } " ) )
10821082
1083- { :error , :enotdir } ->
1084- if File . exists? ( path ) do
1085- IO . puts ( IEx . color ( :eval_info , Path . absname ( path ) ) )
1086- else
1087- IO . puts ( IEx . color ( :eval_error , "No such file or directory #{ path } " ) )
1088- end
1089-
10901083 { :error , reason } ->
1091- IO . puts ( IEx . color ( :eval_error , :file . format_error ( reason ) ) )
1084+ cond do
1085+ File . exists? ( path ) and not File . dir? ( path ) ->
1086+ IO . puts ( IEx . color ( :eval_info , Path . absname ( path ) ) )
1087+
1088+ reason == :enotdir ->
1089+ IO . puts ( IEx . color ( :eval_error , "No such file or directory #{ path } " ) )
1090+
1091+ true ->
1092+ IO . puts ( IEx . color ( :eval_error , :file . format_error ( reason ) ) )
1093+ end
10921094 end
10931095
10941096 dont_display_result ( )
You can’t perform that action at this time.
0 commit comments