Skip to main content

prepare

Function prepare 

Source
pub fn prepare(
    output: &Path,
    source: OutputSource,
    canonical_target: &Path,
) -> Result<Prepared, RkError>
Expand description

Resolve where the stage will stand, refuse a stage inside the target, refuse an existing nonempty output, create the parent, and name the canonical stage root.

Nothing is created before the stage root is known and judged against the target: a stage below the target would be a write inside the repository this verb promises to leave alone, whichever of the flag, the variable, or the state root put it there. Below the state root every directory this creates is owner-only, and a base that turns out to be a link or another file type refuses, because a private stage under a directory somebody else controls is not private.

ยงErrors

Returns a destructive-refusal for a stage root at or below the target, a state-drift refusal for an existing nonempty output, a refusal for an output whose final component is no name, and RkError::Io for a parent that cannot be created or read.