summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Toland <phil.toland@gmail.com>2012-02-02 17:17:18 -0600
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-02-16 11:40:57 +0100
commit8b486055e4c8ca473a7b9f389ea8477f3bf5e996 (patch)
tree4057b2046de5c3647a19bec50d5c8f607c6afab8
parent7e84634b8fcdf8fd88f39c6b70fb7a5798b40bba (diff)
Fix compiling DTL templates with latest erlydtl
The latest version of erlydtl requires that custom tag modules be in the path when templates are compiled. Without this change rebar silently exits when using the custom_tags_modules option.
-rw-r--r--src/rebar_erlydtl_compiler.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rebar_erlydtl_compiler.erl b/src/rebar_erlydtl_compiler.erl
index 821ab4a..664b0f3 100644
--- a/src/rebar_erlydtl_compiler.erl
+++ b/src/rebar_erlydtl_compiler.erl
@@ -82,12 +82,16 @@
compile(Config, _AppFile) ->
DtlOpts = erlydtl_opts(Config),
- rebar_base_compiler:run(Config, [],
- option(doc_root, DtlOpts),
- option(source_ext, DtlOpts),
- option(out_dir, DtlOpts),
- option(module_ext, DtlOpts) ++ ".beam",
- fun compile_dtl/3, [{check_last_mod, false}]).
+ OrigPath = code:get_path(),
+ true = code:add_path(filename:join(rebar_utils:get_cwd(), "ebin")),
+ Result = rebar_base_compiler:run(Config, [],
+ option(doc_root, DtlOpts),
+ option(source_ext, DtlOpts),
+ option(out_dir, DtlOpts),
+ option(module_ext, DtlOpts) ++ ".beam",
+ fun compile_dtl/3, [{check_last_mod, false}]),
+ true = code:set_path(OrigPath),
+ Result.
%% ===================================================================