Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Git = Dependency{ Name: "Git", CmdFactory: func() *exec.Cmd { return exec.Command("git", "--version") }, Help: `Git is required to clone the starter-game-template. Learn how to install Git: https://github.com/git-guides/install-git`, } Go = Dependency{ Name: "Go", CmdFactory: func() *exec.Cmd { return exec.Command("go", "version") }, Help: `Go is required to build and run World Engine game shards. Learn how to install Go: https://go.dev/doc/install`, } Docker = Dependency{ Name: "Docker", CmdFactory: func() *exec.Cmd { return exec.Command("docker", "--version") }, Help: `Docker is required to build and run World Engine game shards. Learn how to install Docker: https://docs.docker.com/engine/install/`, } DockerDaemon = Dependency{ Name: "Docker daemon is running", CmdFactory: func() *exec.Cmd { return exec.Command("docker", "info") }, Help: `Docker daemon needs to be running. If you use Docker Desktop, make sure that you have ran it`, } AlwaysFail = Dependency{ Name: "Always fails", CmdFactory: func() *exec.Cmd { return exec.Command("false") }, Help: `This dependency check will always fail. It can be used for testing.`, } )
Functions ¶
func Check ¶
func Check(deps ...Dependency) error
func CheckCmd ¶
func CheckCmd(deps ...Dependency) tea.Cmd
CheckCmd returns a Tea command that checks the given dependencies.
func FormatMissing ¶
FormatMissing returns a formatted block for displaying missing dependencies.
func FormatStatuses ¶
FormatStatuses returns a formatted status list and help text for missing deps.
Types ¶
type CheckResult ¶
CheckResult is the Tea message returned after checking dependencies.
type CmdFactory ¶
CmdFactory creates a new exec.Cmd for each check. This is necessary because exec.Cmd can only be Run() once.
type Dependency ¶
type Dependency struct {
Name string
CmdFactory CmdFactory
Help string
}
func (Dependency) Check ¶
func (d Dependency) Check() error
type Status ¶
type Status struct {
Dependency
Installed bool
}
Status wraps a Dependency with its check result.
Click to show internal directories.
Click to hide internal directories.