Skip to content

Commit

Permalink
Fix base64-key input
Browse files Browse the repository at this point in the history
  • Loading branch information
Link- committed Jul 7, 2024
1 parent 61aa3df commit b15d401
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ func Generate(c *cli.Context) error {
silent := c.Bool("silent")

if keyPath == "" && keyBase64 == "" {
return fmt.Errorf("either --key or --key-base64 must be specified")
return fmt.Errorf("either --key or --base64-key must be specified")
}

if keyPath != "" && keyBase64 != "" {
return fmt.Errorf("only one of --key or --key-base64 may be specified")
return fmt.Errorf("only one of --key or --base64-key may be specified")
}

if hostname != "api.github.com" && !strings.Contains(hostname, "/api/v3") {
Expand Down
6 changes: 3 additions & 3 deletions internal/installations.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import (
func Installations(c *cli.Context) error {
appID := c.String("app-id")
keyPath := c.String("key")
keyBase64 := c.String("key-base64")
keyBase64 := c.String("base64-key")
hostname := strings.ToLower(c.String("hostname"))

if keyPath == "" && keyBase64 == "" {
return fmt.Errorf("either --key or --key-base64 must be specified")
return fmt.Errorf("either --key or --base64-key must be specified")
}

if keyPath != "" && keyBase64 != "" {
return fmt.Errorf("only one of --key or --key-base64 may be specified")
return fmt.Errorf("only one of --key or --base64-key may be specified")
}

if hostname != "api.github.com" && !strings.Contains(hostname, "/api/v3") {
Expand Down

0 comments on commit b15d401

Please sign in to comment.