diff options
Diffstat (limited to 'src/rebar_prv_edoc.erl')
-rw-r--r-- | src/rebar_prv_edoc.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rebar_prv_edoc.erl b/src/rebar_prv_edoc.erl index 97f70a9..6e58ad5 100644 --- a/src/rebar_prv_edoc.erl +++ b/src/rebar_prv_edoc.erl @@ -84,9 +84,8 @@ format_error(Reason) -> has_configured_paths(EdocOpts) -> proplists:get_value(dir, EdocOpts) =/= undefined. -add_to_paths([], Path) -> - [{doc_path, [Path]}]; -add_to_paths([{doc_path, Paths}|T], Path) -> - [{doc_path, [Path | Paths]} | T]; -add_to_paths([H|T], Path) -> - [H | add_to_paths(Path, T)]. +add_to_paths(Opts, Path) -> + case proplists:get_value(doc_path, Opts) of + undefined -> [{doc_path, [Path]} | Opts]; + Paths -> lists:keyreplace(doc_path, 1, Opts, {doc_path, [Path | Paths]}) + end. |