A fork of mtelver's day10 project

Single package in a list

+23 -15
+23 -15
bin/main.ml
··· 457 457 output config results 458 458 459 459 let run_health_check_multi (config : Config.t) package_arg = 460 - let packages = expand_package_arg package_arg in 461 - (* Ensure output directories exist for multi-package builds *) 462 - let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.json in 463 - let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.md in 464 - let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.dot in 465 - let run_with_package pkg_name = 466 - let json = Option.map (fun path -> Path.(path / pkg_name ^ ".json")) config.json in 467 - let md = Option.map (fun path -> Path.(path / pkg_name ^ ".md")) config.md in 468 - let dot = Option.map (fun path -> Path.(path / pkg_name ^ ".dot")) config.dot in 469 - let config = { config with package = pkg_name; json; md; dot } in 470 - run_health_check config 471 - in 472 - match config.fork with 473 - | Some n -> Os.fork ~np:n run_with_package packages 474 - | None -> List.iter run_with_package packages 460 + match package_arg.[0] = '@' with 461 + | false -> 462 + (* Single package: use paths as-is (files, not directories) *) 463 + let config = { config with package = package_arg } in 464 + run_health_check config 465 + | true -> 466 + let filename = String.sub package_arg 1 (String.length package_arg - 1) in 467 + let packages = Json_packages.read_packages filename in 468 + (* Multiple packages: treat paths as directories *) 469 + let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.json in 470 + let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.md in 471 + let () = Option.iter (fun path -> Os.mkdir ~parents:true path) config.dot in 472 + let run_with_package pkg_name = 473 + let json = Option.map (fun path -> Path.(path / pkg_name ^ ".json")) config.json in 474 + let md = Option.map (fun path -> Path.(path / pkg_name ^ ".md")) config.md in 475 + let dot = Option.map (fun path -> Path.(path / pkg_name ^ ".dot")) config.dot in 476 + let config = { config with package = pkg_name; json; md; dot } in 477 + run_health_check config 478 + in 479 + match config.fork with 480 + | Some 1 481 + | None -> List.iter run_with_package packages 482 + | Some n -> Os.fork ~np:n run_with_package packages 475 483 476 484 let cache_dir_term = 477 485 let doc = "Directory to use for caching (required)" in