Skip to content

Commit

Permalink
Merge pull request #51 from shopetan/fix_google_base_url
Browse files Browse the repository at this point in the history
Fix google base url
  • Loading branch information
KeisukeYamashita authored Oct 8, 2019
2 parents 755d758 + 1b0b2a7 commit 63300de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cli/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ func newGoogleCmd() cli.Command {
return cli.Command{
Name: "google",
Aliases: []string{"g"},
Usage: "Open GCP resource",
Usage: "Open Google source",
Flags: []cli.Flag{
cli.StringFlag{
Name: "project",
Usage: "Specify the project to open",
},
},
Action: func(c *cli.Context) error {
gcp, err := google.GetProvider()
g, err := google.GetProvider()
if err != nil {
return err
}
return browser.Open(c, gcp)
return browser.Open(c, g)
},
Subcommands: []cli.Command{
newGoogleSearchCmd(),
Expand All @@ -42,11 +42,11 @@ func newGoogleSearchCmd() cli.Command {
},
},
Action: func(c *cli.Context) error {
gcp, err := google.GetProvider()
g, err := google.GetProvider()
if err != nil {
return err
}
return browser.Open(c, gcp)
return browser.Open(c, g)
},
}

Expand Down
2 changes: 1 addition & 1 deletion providers/google/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ func (p *Provider) GetTargetURL() (string, error) {
if p.baseURL, err = url.Parse(baseURL); err != nil {
return "", err
}

p.addProductPath(p.Ctx.Command.Name)
return p.URL.String(), nil
}

func (p *Provider) addProductPath(product string) {
p.URL = p.baseURL
switch product {
case "search":
p.join("search")
Expand Down

0 comments on commit 63300de

Please sign in to comment.