pub fn display_dry_run_results(
new_lockfile: &LockFile,
existing_lockfile: Option<&LockFile>,
quiet: bool,
) -> Result<()>Expand description
Display dry-run results with rich categorization of changes.
Shows new resources, updated resources, and unchanged count. IMPORTANT: Returns an error (exit code 1) if changes are detected, making this suitable for CI validation workflows.
§Arguments
new_lockfile- The lockfile that would be createdexisting_lockfile- The current lockfile if it existsquiet- Whether to suppress output
§Returns
Ok(())- No changes detected (exit code 0)Err(...)- Changes detected (exit code 1 for CI validation)
§CI/CD Usage
This function is designed for CI validation workflows where you want to detect if running install/update would make changes:
# CI pipeline check - fails if dependencies need updating
agpm install --dry-run # Exit code 1 if changes needed
agpm update --dry-run # Exit code 1 if updates available§Examples
let new_lockfile = LockFile::new();
let existing_lockfile = None;
// In CI: this will return Err if changes detected
display_dry_run_results(
&new_lockfile,
existing_lockfile.as_ref(),
false,
)?;§Output Format
When changes are detected, displays:
- New resources: Resources that would be installed (green)
- Updated resources: Resources that would be updated (yellow)
- Unchanged count: Resources that are already up to date (dimmed)