We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b41b5d commit 6181590Copy full SHA for 6181590
1 file changed
cmd/doctor.go
@@ -28,13 +28,18 @@ var doctorCmd = &cobra.Command{
28
29
// Docker
30
checkDocker()
31
+
32
+ // Git
33
+ checkGit()
34
},
35
}
36
37
func init() {
38
rootCmd.AddCommand(doctorCmd)
39
40
41
+// ---- helpers ----
42
43
func checkDocker() {
44
cmd := exec.Command("docker", "--version")
45
@@ -48,3 +53,17 @@ func checkDocker() {
48
53
49
54
fmt.Println("Docker:", strings.TrimSpace(out.String()))
50
55
56
57
+func checkGit() {
58
+ cmd := exec.Command("git", "--version")
59
60
+ var out bytes.Buffer
61
+ cmd.Stdout = &out
62
63
+ if err := cmd.Run(); err != nil {
64
+ fmt.Println("Git: not installed")
65
+ return
66
+ }
67
68
+ fmt.Println("Git:", strings.TrimSpace(out.String()))
69
+}
0 commit comments