Skip to content

Commit 91247de

Browse files
committed
Use input rather than output for sanity check for mlds
1 parent 607d8e5 commit 91247de

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/odoc/bin/main.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ end = struct
687687
open Or_error
688688

689689
(** Find the package/library name the output is part of *)
690-
let find_root_of_output l o =
690+
let find_root_of_input l o =
691691
let l =
692692
List.map
693693
~f:(fun (x, p) ->
@@ -714,7 +714,7 @@ end = struct
714714
| None -> Error `Not_found)
715715

716716
let current_library_of_input lib_roots input =
717-
match find_root_of_output lib_roots input with
717+
match find_root_of_input lib_roots input with
718718
| Ok _ as ok -> ok
719719
| Error `Not_found ->
720720
Error (`Msg "The output file must be part of a directory passed as -L")
@@ -744,8 +744,8 @@ end = struct
744744
| _ -> Ok current_package)
745745
| None -> Ok detected_package
746746

747-
let current_package_of_page ~current_package page_roots output =
748-
match find_root_of_output page_roots output with
747+
let current_package_of_page ~current_package page_roots input =
748+
match find_root_of_input page_roots input with
749749
| Ok detected_package ->
750750
validate_current_package ?detected_package page_roots current_package
751751
| Error `Not_found ->
@@ -770,7 +770,7 @@ end = struct
770770
let is_page = is_page input in
771771
(if is_page then Ok None else current_library_of_input lib_roots input)
772772
>>= fun current_lib ->
773-
(if is_page then current_package_of_page ~current_package page_roots output
773+
(if is_page then current_package_of_page ~current_package page_roots input
774774
else validate_current_package page_roots current_package)
775775
>>= fun current_package ->
776776
let current_dir = Fs.File.dirname output in

0 commit comments

Comments
 (0)