tangled
alpha
login
or
join now
jon.recoil.org
/
day10
0
fork
atom
A fork of mtelver's day10 project
0
fork
atom
overview
issues
pulls
pipelines
My fork() is best
Mark Elvers
4 months ago
88b9f8a9
71d68453
+13
-12
1 changed file
expand all
collapse all
unified
split
bin
main.ml
+13
-12
bin/main.ml
···
458
458
459
459
let run_health_check_multi (config : Config.t) package_arg =
460
460
let packages = expand_package_arg package_arg in
461
461
+
(* Ensure output directories exist for multi-package builds *)
462
462
+
let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.json in
463
463
+
let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.md in
464
464
+
let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.dot in
465
465
+
let run_with_package pkg_name =
466
466
+
let json = Option.map (fun path -> Path.(path / pkg_name ^ ".json")) config.json in
467
467
+
let md = Option.map (fun path -> Path.(path / pkg_name ^ ".md")) config.md in
468
468
+
let dot = Option.map (fun path -> Path.(path / pkg_name ^ ".dot")) config.dot in
469
469
+
let config = { config with package = pkg_name; json; md; dot } in
470
470
+
run_health_check config
471
471
+
in
461
472
match config.fork with
462
462
-
| Some n ->
463
463
-
Os.fork ~np:n
464
464
-
(fun pkg_name ->
465
465
-
let config = { config with package = pkg_name } in
466
466
-
run_health_check config)
467
467
-
packages
468
468
-
| None ->
469
469
-
List.iter
470
470
-
(fun pkg_name ->
471
471
-
let config = { config with package = pkg_name } in
472
472
-
run_health_check config)
473
473
-
packages
473
473
+
| Some n -> Os.fork ~np:n run_with_package packages
474
474
+
| None -> List.iter run_with_package packages
474
475
475
476
let cache_dir_term =
476
477
let doc = "Directory to use for caching (required)" in