Fix crash introduced in 4414f65 via pull/245

This commit is contained in:
Tuncer Ayaz 2012-06-30 22:14:08 +02:00
parent 0c27fd4f7f
commit 49f3cc4108

View file

@ -64,8 +64,8 @@
?CONSOLE("Available templates:\n", []), ?CONSOLE("Available templates:\n", []),
_ = [begin _ = [begin
BaseName = filename:basename(F, ".template"), BaseName = filename:basename(F, ".template"),
{ok, Template} = file:consult(F), TemplateTerms = consult(load_file(Type, F)),
{_, VarList} = lists:keyfind(variables, 1, Template), {_, VarList} = lists:keyfind(variables, 1, TemplateTerms),
Vars = lists:foldl(fun({V,_}, Acc) -> Vars = lists:foldl(fun({V,_}, Acc) ->
[atom_to_list(V) | Acc] [atom_to_list(V) | Acc]
end, [], VarList), end, [], VarList),