fix: change installation package path for protoc-gen-openapi (#1759)

* fix: change installation package path for protoc-gen-openapi


Co-authored-by: haiyux <haiyux@foxmail.com>
pull/1762/head
Heelie 3 years ago committed by GitHub
parent 8bb55663d9
commit d082075676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      cmd/kratos/internal/base/install.go
  2. 2
      cmd/kratos/internal/upgrade/upgrade.go

@ -7,13 +7,17 @@ import (
"fmt" "fmt"
"os" "os"
"os/exec" "os/exec"
"strings"
) )
// GoInstall go get path. // GoInstall go get path.
func GoInstall(path ...string) error { func GoInstall(path ...string) error {
for _, p := range path { for _, p := range path {
fmt.Printf("go install %s@latest\n", p) if !strings.Contains(p, "@") {
cmd := exec.Command("go", "install", fmt.Sprintf("%s@latest", p)) p += "@latest"
}
fmt.Printf("go install %s\n", p)
cmd := exec.Command("go", "install", p)
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {

@ -26,7 +26,7 @@ func Run(cmd *cobra.Command, args []string) {
"google.golang.org/grpc/cmd/protoc-gen-go-grpc", "google.golang.org/grpc/cmd/protoc-gen-go-grpc",
"github.com/envoyproxy/protoc-gen-validate", "github.com/envoyproxy/protoc-gen-validate",
"github.com/google/gnostic", "github.com/google/gnostic",
"github.com/google/gnostic/apps/protoc-gen-openapi", "github.com/google/gnostic/cmd/protoc-gen-openapi@v0.6.2",
) )
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)

Loading…
Cancel
Save