Skip to content

Commit

Permalink
feat: check for gh binary
Browse files Browse the repository at this point in the history
  • Loading branch information
flexwie committed Dec 12, 2024
1 parent 7363caf commit b45c71d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package main

import (
"context"
"errors"
"os"

"github.com/charmbracelet/log"
"github.com/cli/go-gh/v2"
"github.com/flexwie/ghs/pkg"
"github.com/urfave/cli/v2"
)
Expand All @@ -30,6 +32,11 @@ func main() {
{Name: "Felix Wieland", Email: "[email protected]"},
},
Action: func(ctx *cli.Context) error {
_, err := gh.Path()
if err != nil {
return errors.New("gh cli is not installed")
}

gist := ctx.Args().Get(0)
if len(gist) == 0 {
return cli.Exit("no gist provided", 2)
Expand Down

0 comments on commit b45c71d

Please sign in to comment.