Skip to main content

execute

Function execute 

Source
pub fn execute(args: &InitArgs, cwd: &Path) -> Result<i32>
Expand description

Execute haz init against cwd.

Returns 0 on a successful scaffold per AUX-008. Conflicts (AUX-002) and filesystem write failures map to a non-zero return through the internal-or-configuration-error class.

ยงErrors

Returns a miette::Report when <cwd>/.haz/ already exists, when the interactive flow surfaces a commit-plan failure (e.g. AUX-005 name sanitisation), or when any filesystem step (mkdir, tmp write, fsync, rename) fails. The binary maps the report to crate::EXIT_INTERNAL_OR_CONFIG_ERROR.