Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions internal/installcmd/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand All @@ -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},
Expand Down
6 changes: 5 additions & 1 deletion internal/system/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down