This commit is contained in:
jb
2026-03-05 08:46:04 -03:00
commit 315807bbab
10 changed files with 308 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package tui
import (
"os/exec"
tea "charm.land/bubbletea/v2"
)
// --- Messages ---
type DockerCheckedMsg struct{ Installed bool }
type DockerInstalledMsg struct{ Err error }
// --- Commands ---
func CheckDockerCmd() tea.Cmd {
return func() tea.Msg {
_, err := exec.LookPath("docker")
return DockerCheckedMsg{Installed: err == nil}
}
}
func InstallDockerCmd() tea.Cmd {
return func() tea.Msg {
err := exec.Command("sh", "-c", "curl -fsSL https://get.docker.com | sh").Run()
return DockerInstalledMsg{Err: err}
}
}