Skip to main content

plan

Function plan 

Source
pub fn plan(root: &Path, share: &Path, profile: Option<&str>) -> Planned
Expand description

Plan a pack of the repository at root with a profile of the distribution at share: the index’s blobs, selected by the profile, cut into shards and judged. Nothing is written; a tree or a profile that cannot be read is an unmeasured plan, never a pass.

The examples below plan a repository holding main.rs and a logo.png whose content is binary, with a distribution whose chat profile has limits and whose bare one has none.

use majordomus_cli::pack::plan;
let planned = plan(&root, &share, None);
assert!(planned.plan.passes, "{:?}", planned.plan.findings);
assert_eq!(planned.plan.profile, "chat");
assert_eq!(planned.plan.shards.len(), 1);