summaryrefslogtreecommitdiff
path: root/src/rebar_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_utils.erl')
-rw-r--r--src/rebar_utils.erl14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index 5f1612c..7265058 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -4,7 +4,7 @@
%%
%% rebar: Erlang Build Tools
%%
-%% Copyright (c) 2009 Dave Smith (dizzyd@dizzyd.com)
+%% Copyright (c) 2009, 2010 Dave Smith (dizzyd@dizzyd.com)
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,8 @@
sh_failfast/2,
find_files/2,
now_str/0,
- ensure_dir/1]).
+ ensure_dir/1,
+ beam_to_mod/2, beams/1]).
-include("rebar.hrl").
@@ -132,3 +133,12 @@ sh_loop(Port) ->
{Port, {exit_status, Rc}} ->
{error, Rc}
end.
+
+beam_to_mod(Dir, Filename) ->
+ [Dir | Rest] = filename:split(Filename),
+ list_to_atom(filename:basename(string:join(Rest, "."), ".beam")).
+
+beams(Dir) ->
+ filelib:fold_files(Dir, ".*\.beam\$", true,
+ fun(F, Acc) -> [F | Acc] end, []).
+