Skip to content

Commit b45c71d

Browse files
committed
feat: check for gh binary
1 parent 7363caf commit b45c71d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.go

+7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ package main
22

33
import (
44
"context"
5+
"errors"
56
"os"
67

78
"github.com/charmbracelet/log"
9+
"github.com/cli/go-gh/v2"
810
"github.com/flexwie/ghs/pkg"
911
"github.com/urfave/cli/v2"
1012
)
@@ -30,6 +32,11 @@ func main() {
3032
{Name: "Felix Wieland", Email: "ghs@felixwie.com"},
3133
},
3234
Action: func(ctx *cli.Context) error {
35+
_, err := gh.Path()
36+
if err != nil {
37+
return errors.New("gh cli is not installed")
38+
}
39+
3340
gist := ctx.Args().Get(0)
3441
if len(gist) == 0 {
3542
return cli.Exit("no gist provided", 2)

0 commit comments

Comments
 (0)