look for templates in local directory as well

This commit is contained in:
Bryan Fink 2010-02-04 14:30:10 -05:00
parent 2734f2bcc2
commit 4e01b32d5d

View file

@ -127,8 +127,9 @@ find_escript_templates() ->
re:run(Name, ?TEMPLATE_RE, [{capture, none}]) == match].
find_disk_templates() ->
Files = rebar_utils:find_files(filename:join(os:getenv("HOME"), ".rebar/templates"), ?TEMPLATE_RE),
[{file, F} || F <- Files].
HomeFiles = rebar_utils:find_files(filename:join(os:getenv("HOME"), ".rebar/templates"), ?TEMPLATE_RE),
LocalFiles = rebar_utils:find_files(".", ?TEMPLATE_RE),
[{file, F} || F <- HomeFiles++LocalFiles].
select_template([], Template) ->
?ABORT("Template ~s not found.\n", [Template]);