diff --git a/internal/installcmd/resolver.go b/internal/installcmd/resolver.go index 4cdf9cce8..42ca7e4cc 100644 --- a/internal/installcmd/resolver.go +++ b/internal/installcmd/resolver.go @@ -174,6 +174,8 @@ func (profileResolver) ResolveDependencyInstall(profile system.PlatformProfile, return CommandSequence{{"sudo", "dnf", "install", "-y", dependency}}, nil case "winget": return CommandSequence{{"winget", "install", "--id", dependency, "-e", "--accept-source-agreements", "--accept-package-agreements"}}, nil + case "pkg": + return CommandSequence{{"pkg", "install", "-y", dependency}}, nil default: return nil, fmt.Errorf( "unsupported package manager %q for os=%q distro=%q", @@ -194,7 +196,7 @@ func resolveOpenCodeInstall(profile system.PlatformProfile) (CommandSequence, er return CommandSequence{ {"brew", "install", "anomalyco/tap/opencode"}, }, nil - case "apt", "pacman", "dnf": + case "apt", "pacman", "dnf", "pkg": pkg := "opencode-ai@" + versions.OpenCode if profile.NpmWritable { return CommandSequence{{"npm", "install", "-g", "--ignore-scripts", pkg}}, nil @@ -221,8 +223,8 @@ func resolveGGAInstall(profile system.PlatformProfile) (CommandSequence, error) {"brew", "tap", "Gentleman-Programming/homebrew-tap"}, {"brew", "reinstall", "gga"}, }, nil - case "apt", "pacman", "dnf": - const tmpDir = "/tmp/gentleman-guardian-angel" + case "apt", "pacman", "dnf", "pkg": + tmpDir := filepath.Join(os.TempDir(), "gentleman-guardian-angel") return CommandSequence{ {"rm", "-rf", tmpDir}, {"git", "clone", "https://github.com/Gentleman-Programming/gentleman-guardian-angel.git", tmpDir}, diff --git a/internal/system/detect.go b/internal/system/detect.go index dea63d866..e680176a0 100644 --- a/internal/system/detect.go +++ b/internal/system/detect.go @@ -41,7 +41,7 @@ type DetectionResult struct { } func IsSupportedOS(goos string) bool { - return goos == "darwin" || goos == "linux" || goos == "windows" + return goos == "darwin" || goos == "linux" || goos == "windows" || goos == "android" } func Detect(ctx context.Context) (DetectionResult, error) { @@ -158,6 +158,10 @@ func resolvePlatformProfile(goos, linuxOSRelease string, tools map[string]ToolSt profile.PackageManager = "winget" profile.Supported = true return profile + case "android": + profile.PackageManager = "pkg" + profile.Supported = true + return profile default: profile.Supported = false return profile