Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDetectTimeoutForTest ¶
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 ¶
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.