-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpf.go
28 lines (24 loc) · 772 Bytes
/
pf.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package checks
import (
"context"
"fmt"
"projectforge.dev/projectforge/app/doctor"
"projectforge.dev/projectforge/app/util"
)
var PF = &doctor.Check{
Key: util.AppKey,
Section: "app",
Title: util.AppName,
Summary: "Confirms that [" + util.AppKey + "] is available on the path",
URL: util.AppURL,
UsedBy: util.AppName,
Fn: simpleOut(".", "projectforge", []string{"--help"}, noop),
Solve: solvePF,
}
func solvePF(_ context.Context, r *doctor.Result, _ util.Logger) *doctor.Result {
if r.Errors.Find("missing") != nil || r.Errors.Find("exitcode") != nil {
msg := "Install [%s] by following the instructions at [%s], and ensure [%s] is on your path"
r.AddSolution(fmt.Sprintf(msg, util.AppName, util.AppURL, util.AppKey))
}
return r
}