File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed
test/blackbox-tests/test-cases/subst Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -182,8 +182,27 @@ let files =
182182 in
183183 let f run args t =
184184 let open Fiber.O in
185- let + l = run t args in
186- List. map l ~f: Path.Source. of_string
185+ let f =
186+ let prefix =
187+ Path. to_absolute_filename t.root |> Path.External. of_string |> Path. external_
188+ in
189+ let source_root =
190+ Path. to_absolute_filename (Path. source Path.Source. root)
191+ |> Path.External. of_string
192+ |> Path. external_
193+ in
194+ match Path. drop_prefix source_root ~prefix with
195+ | None -> fun p -> Some (Path.Source. of_string p)
196+ | Some prefix ->
197+ fun p ->
198+ (match
199+ let p = Path.Local. of_string p in
200+ Path.Local. descendant p ~of_: prefix
201+ with
202+ | None -> None
203+ | Some p -> Some (Path.Source. of_local p))
204+ in
205+ run t args >> | List. filter_map ~f
187206 in
188207 Staged. unstage
189208 @@ make_fun
Original file line number Diff line number Diff line change @@ -14,8 +14,3 @@ Regression test for https://github.com/ocaml/dune/issues/11045
1414 $ git add -A && git commit -- quiet -- message " Initial commit"
1515 $ cd subfolder
1616 $ dune subst
17- File " ." , line 1 , characters 0 -0:
18- Error: There is no dune-project file in the current directory, please add one
19- with a (name <name >) field in it.
20- Hint: ' dune subst' must be executed from the root of the project.
21- [1 ]
You can’t perform that action at this time.
0 commit comments