mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Use lists:foreach because result is ignored
This commit is contained in:
parent
385e3f09ba
commit
fd0697239d
1 changed files with 11 additions and 10 deletions
|
@ -62,16 +62,17 @@
|
||||||
%% Build a list of available templates
|
%% Build a list of available templates
|
||||||
AvailTemplates = find_disk_templates() ++ find_escript_templates(),
|
AvailTemplates = find_disk_templates() ++ find_escript_templates(),
|
||||||
?CONSOLE("Available templates:\n", []),
|
?CONSOLE("Available templates:\n", []),
|
||||||
_ = [begin
|
lists:foreach(
|
||||||
BaseName = filename:basename(F, ".template"),
|
fun({Type, F}) ->
|
||||||
TemplateTerms = consult(load_file(Type, F)),
|
BaseName = filename:basename(F, ".template"),
|
||||||
{_, VarList} = lists:keyfind(variables, 1, TemplateTerms),
|
TemplateTerms = consult(load_file(Type, F)),
|
||||||
Vars = lists:foldl(fun({V,_}, Acc) ->
|
{_, VarList} = lists:keyfind(variables, 1, TemplateTerms),
|
||||||
[atom_to_list(V) | Acc]
|
Vars = lists:foldl(fun({V,_}, Acc) ->
|
||||||
end, [], VarList),
|
[atom_to_list(V) | Acc]
|
||||||
?CONSOLE(" * ~s: ~s (~p) (variables: ~p)\n",
|
end, [], VarList),
|
||||||
[BaseName, F, Type, string:join(Vars, ", ")])
|
?CONSOLE(" * ~s: ~s (~p) (variables: ~p)\n",
|
||||||
end || {Type, F} <- AvailTemplates],
|
[BaseName, F, Type, string:join(Vars, ", ")])
|
||||||
|
end, AvailTemplates),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue