Skip to main content

apply_init

Function apply_init 

Source
pub fn apply_init(
    target_dir: &Path,
    force: bool,
) -> Result<ApplyResult, ApplyError>
Expand description

Apply rust-bucket to a target directory for the first time.

Implements the first-time flow described in ARCHITECTURE.md.

§Arguments

  • target_dir - The target directory to apply rust-bucket to
  • force - If true, overwrite existing managed files; if false, fail on conflicts

§Errors

Returns ApplyError if:

  • The target is not a Rust crate (no Cargo.toml)
  • The target is not a git repository (no .git/)
  • Conflicting files exist and force is false
  • Any step in the process fails (config save, template extraction, rendering, verification)