Skip to content

Commit

Permalink
fix relative path does not work on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
zyuyou authored and 5HT committed May 23, 2023
1 parent 646522a commit 23a5b46
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/fs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,21 @@ loop() ->
loop().

find_executable(Cmd, DepsPath) ->
case priv_file(Cmd) of
false -> mad_file(DepsPath);
Priv -> Priv
Executable =
case priv_file(Cmd) of
false -> mad_file(DepsPath);
Priv -> Priv
end,
case filename:pathtype(Executable) of
relative ->
filename:join(path(), Executable);
_PathType ->
Executable
end.

mad_file(DepsPath) ->
case filelib:is_regular(DepsPath) of
true -> path() ++ "/" ++ DepsPath;
true -> DepsPath;
false ->
case load_file(DepsPath) of
{error, _} ->
Expand Down

0 comments on commit 23a5b46

Please sign in to comment.