Browse files

Merge pull request #57 from pickme467/guess_source

Optimized guessing the source file for folder trees
  • Loading branch information...
2 parents b0bd2ad + 602ceca commit 0ca3d73d90e87e72bdcaeb7de2126553ad5742fd @massemanet committed May 25, 2016
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/distel.erl
View
7 src/distel.erl
@@ -180,16 +180,13 @@ find_source(Mod) ->
end.
%% Ret: AbsName | throw(Reason)
+%% Ret: AbsName | throw(Reason)
guess_source_file(Mod, BeamFName) ->
Erl = to_list(Mod) ++ ".erl",
Dir = dirname(BeamFName),
DotDot = dirname(Dir),
try_srcs([src_from_beam(Mod),
- join([Dir, Erl]),
- join([DotDot, "src", Erl]),
- join([DotDot, "src", "*", Erl]),
- join([DotDot, "esrc", Erl]),
- join([DotDot, "erl", Erl])]).
+ filelib:wildcard(join([DotDot, "**", Erl]))]).
try_srcs([]) -> throw(nothing);
try_srcs(["" | T]) -> try_srcs(T);

0 comments on commit 0ca3d73

Please sign in to comment.