diff options
author | David N. Welton <davidw@dedasys.com> | 2014-02-14 11:48:51 +0100 |
---|---|---|
committer | Andreas Stenius <git@astekk.se> | 2014-02-14 13:35:51 +0100 |
commit | f7d62dee68c7c34866a5b4c5a17078dc4899cc9a (patch) | |
tree | 7ef149eab4de324eac8461b6706116b8a39e6c85 | |
parent | 33110267bae3ff3b0511267016a1915c01e8d287 (diff) |
Use proplists:unfold to make sure we feed a proplist to keymerge.
-rw-r--r-- | src/rebar_erlydtl_compiler.erl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/rebar_erlydtl_compiler.erl b/src/rebar_erlydtl_compiler.erl index ae64bcb..df7186c 100644 --- a/src/rebar_erlydtl_compiler.erl +++ b/src/rebar_erlydtl_compiler.erl @@ -199,16 +199,17 @@ do_compile(Config, Source, Target, DtlOpts) -> %% versions of erlydtl. CompilerOptions = option(compiler_options, DtlOpts), + Sorted = proplists:unfold( + lists:sort( + [{out_dir, option(out_dir, DtlOpts)}, + {doc_root, option(doc_root, DtlOpts)}, + {custom_tags_dir, option(custom_tags_dir, DtlOpts)}, + {compiler_options, CompilerOptions} + |CompilerOptions])), + %% ensure that doc_root and out_dir are defined, %% using defaults if necessary - Opts = lists:ukeymerge(1, - DtlOpts, - lists:sort( - [{out_dir, option(out_dir, DtlOpts)}, - {doc_root, option(doc_root, DtlOpts)}, - {custom_tags_dir, option(custom_tags_dir, DtlOpts)}, - {compiler_options, CompilerOptions} - |CompilerOptions])), + Opts = lists:ukeymerge(1, DtlOpts, Sorted), ?INFO("Compiling \"~s\" -> \"~s\" with options:~n ~s~n", [Source, Target, io_lib:format("~p", [Opts])]), case erlydtl:compile(Source, |