mirror of
https://github.com/gogrlx/snack.git
synced 2026-04-02 05:08:42 -07:00
Implements the full snack.Manager interface for winget: - Install/Remove/Purge/Upgrade via winget CLI - Search/List/Info/IsInstalled/Version queries - Source (repository) management via RepoManager - Version querying via VersionQuerier - Targeted package upgrades via PackageUpgrader - Name normalization via NameNormalizer All commands use --disable-interactivity, --accept-source-agreements, and --accept-package-agreements for non-interactive operation. Parser handles winget's fixed-width tabular output by detecting column positions from the header/separator lines. Includes VT100 escape sequence stripping and progress line filtering. Windows-only via build tags; other platforms return ErrUnsupportedPlatform. Registered in detect_windows.go as the default Windows package manager.
21 lines
420 B
Go
21 lines
420 B
Go
//go:build windows
|
|
|
|
package detect
|
|
|
|
import (
|
|
"github.com/gogrlx/snack"
|
|
"github.com/gogrlx/snack/winget"
|
|
)
|
|
|
|
// candidates returns manager factories in probe order for Windows.
|
|
func candidates() []managerFactory {
|
|
return []managerFactory{
|
|
func() snack.Manager { return winget.New() },
|
|
}
|
|
}
|
|
|
|
// allManagers returns all known manager factories (for ByName).
|
|
func allManagers() []managerFactory {
|
|
return candidates()
|
|
}
|