Skip to content

Commit

Permalink
Use proplists:unfold to make sure we feed a proplist to keymerge.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidw committed Feb 14, 2014
1 parent 5aadc2a commit d797396
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/rebar_erlydtl_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

2 comments on commit d797396

@kaos
Copy link

@kaos kaos commented on d797396 Feb 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this makes sense. Thanks :)

@kaos
Copy link

@kaos kaos commented on d797396 Feb 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this commit to rebar#221.

Please sign in to comment.