MCPcopy Create free account
hub / github.com/DBCDK/morph / ValidateEnvironment

Function ValidateEnvironment

utils/files.go:20–33  ·  view source on GitHub ↗
(dependencies ...string)

Source from the content-addressed store, hash-verified

18}
19
20func ValidateEnvironment(dependencies ...string) {
21 missingDepencies := make([]string, 0)
22 for _, dependency := range dependencies {
23 _, err := exec.LookPath(dependency)
24 if err != nil {
25 missingDepencies = append(missingDepencies, dependency)
26 }
27 }
28
29 if len(missingDepencies) > 0 {
30 fmt.Fprint(os.Stderr, errors.New("Missing dependencies: '"+strings.Join(missingDepencies, ", ")+"' on $PATH"))
31 Exit(1)
32 }
33}

Callers 3

setupFunction · 0.92
PushFunction · 0.92
sshArgsMethod · 0.92

Calls 1

ExitFunction · 0.85

Tested by

no test coverage detected