Skip to content

Commit

Permalink
flip the logic around on the browser extension invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
chrnorm committed Oct 1, 2024
1 parent 096eb39 commit f7f5057
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/granted/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ func GetCliApp() *cli.App {
// the CLI with the ID of the browser extension as the first argument.
Action: func(c *cli.Context) error {
arg := c.Args().First()
if !strings.HasPrefix(arg, "chrome-extension://") {
// Not invoked via the browser extension, so fall back to the default
// behaviour of showing the application help.
return cli.ShowAppHelp(c)
if strings.HasPrefix(arg, "chrome-extension://") {
// the CLI has been invoked from our browser extension
return HandleChromeExtensionCall(c)
}

// if we get here, the CLI has been invoked from our browser extension
return HandleChromeExtensionCall(c)
// Not invoked via the browser extension, so fall back to the default
// behaviour of showing the application help.
return cli.ShowAppHelp(c)
},
EnableBashCompletion: true,
Before: func(c *cli.Context) error {
Expand Down

0 comments on commit f7f5057

Please sign in to comment.