kit

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDetectTimeoutForTest

func SetDetectTimeoutForTest(d time.Duration) (restore func())

SetDetectTimeoutForTest overrides detectTimeout and returns a restore function. Intended for tests only.

Types

type DetectResult

type DetectResult string

DetectResult is the outcome of running a kit's detection script.

const (
	DetectNotApplicable DetectResult = ""         // script not present, failed, or printed an unknown value
	DetectOptional      DetectResult = "optional" // kit is a candidate — shown but not auto-selected
	DetectRequired      DetectResult = "required" // kit strongly matches — auto-selected
)

func Detect

func Detect(projectDir, kitDir string, kit orchestrator.KitMeta) DetectResult

Detect reports whether the kit is applicable to projectDir by running the kit's detection script (POSIX sh) with projectDir as CWD. See DetectResult for the possible outcomes.

Returns DetectNotApplicable when:

  • kit.Detect is nil
  • kit.Detect.Script is empty
  • the script file does not exist
  • the script exits non-zero
  • the script exceeds detectTimeout
  • the first line of stdout is not "required" or "optional"

type RequirementError

type RequirementError struct {
	KitName string
	Command string
}

RequirementError records a command that is missing from PATH for a specific kit.

func ValidateRequirements

func ValidateRequirements(kits []orchestrator.KitMeta) []RequirementError

ValidateRequirements checks that every command declared in kit.requires.commands is present in PATH. It returns one RequirementError per missing command.

func (RequirementError) Error

func (e RequirementError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL