Skip to main content

Module copy

Module copy 

Source
Expand description

Copy engine — deploy files from the repo to $HOME.

The engine works in two phases:

  1. Plan — pure, no I/O for writes. Walks a Config’s [[link]] and [[template]] entries, expands globs, applies ${VAR} resolution to destinations, and skips entries that don’t match the current platform. Returns a Plan which is a Vec<Action> of Copy / Conflict items the caller can inspect or print.
  2. Execute — performs the planned copies atomically, preserving the source’s mtime + (on Unix) file mode.

What’s deferred:

  • Manifest-aware idempotency — the executor records hashes via crate::manifest but the planner still classifies any existing destination as a Action::Conflict. Issue #15 (krypt link) will compare against the manifest to narrow safe re-deploys.
  • Interactive prompts for conflicts — issue #15 wires the CLI on top.

Structs§

ExecOpts
Knobs for execute.
Plan
A list of Actions to perform (or print, in dry-run mode).
Report
What execute actually did.
Written
One file the executor wrote — surfaced so callers can update the deployment manifest (see crate::manifest).

Enums§

Action
What the engine intends to do for one (src, dst) pair.
EntryKind
Which schema section an action came from.
ExecError
Errors executing a Plan.
PlanError
Errors building a Plan from a Config.

Functions§

execute
Run a Plan against the filesystem.
plan
Build a Plan from a parsed (+ include-expanded) Config.