Skip to main content

plan

Function plan 

Source
pub fn plan(
    roots: &[&Path],
    slug_opts: &SlugOpts,
    plan_opts: &PlanOpts,
) -> Result<Vec<RenamePlan>, FrenError>
Expand description

Build a RenamePlan vector for the given roots.

Walks each root recursively (per opts.recursive), computes new names via slugify_camel_iso_with_year, detects within-batch and pre-existing target conflicts (under the Abort policy), and returns plans sorted deepest-first / files-before-dirs at the same depth.

Errors:

  • FrenError::Io if a root or any descendant cannot be read.
  • FrenError::TargetExists if a planned target already exists outside the batch.
  • FrenError::WithinBatchCollision if two plans target the same path.