summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Sawan <ssawan@virtualhold.com>2017-07-17 13:47:32 -0400
committerSam Sawan <ssawan@virtualhold.com>2017-07-17 13:47:32 -0400
commitd09aaed77d9bd82063fbeda2347e083b752f6e2c (patch)
treecedefd1084a1ccc6466490bf7443b1e5e0811215
parentdee97b11845e00baa1acff92086627662ed8ff42 (diff)
[#149002995] stop eating edoc path config
be a little smarter when generating edocs; loof for some sort of doc path and then replace w/e was there with the updated doc paths
-rw-r--r--src/rebar_prv_edoc.erl11
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.