Skip to main content

clean

Function clean 

Source
pub fn clean(ctx: &Context, args: &CacheCleanArgs) -> Result<i32>
Expand description

Execute haz cache clean against cwd with the supplied CLI args.

Resolves the effective mode set by combining args with workspace cache.clean.* defaults per AUX-025 (CLI overrides workspace), enforces the AUX-022 “at least one mode” rule, runs the unified CacheWriter::clean, and emits the AUX-024 report.

§Errors

Returns a miette::Report on workspace-load failure, on a no-effective-mode invocation, or when the cache root itself cannot be read (the only fatal clean filesystem error per AUX-028). Best-effort per-item failures are NOT returned as a report: they are printed to stderr and yield the EXIT_INTERNAL_OR_CONFIG_ERROR exit class per AUX-027, after the AUX-024 report is emitted.