From 4e01b32d5db959009dbd57d6928725e33b8aa7be Mon Sep 17 00:00:00 2001 From: Bryan Fink Date: Thu, 4 Feb 2010 14:30:10 -0500 Subject: [PATCH] look for templates in local directory as well --- src/rebar_templater.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index 4e2e678..8e07694 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -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]);