Add DryRunner interface and DryRun capability for dry-run support detection

Co-authored-by: taigrr <8261498+taigrr@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-28 06:22:26 +00:00
parent 434c367687
commit 9f943e9097
7 changed files with 35 additions and 0 deletions

View File

@@ -196,6 +196,9 @@ func (a *Apt) ParseArch(name string) (string, string) {
return parseArch(name)
}
// SupportsDryRun reports that apt honors [snack.WithDryRun] via --dry-run.
func (a *Apt) SupportsDryRun() bool { return true }
// Compile-time interface checks.
var (
_ snack.Manager = (*Apt)(nil)
@@ -206,4 +209,5 @@ var (
_ snack.RepoManager = (*Apt)(nil)
_ snack.KeyManager = (*Apt)(nil)
_ snack.NameNormalizer = (*Apt)(nil)
_ snack.DryRunner = (*Apt)(nil)
)