fix(cmd): import format (#2735)

pull/2739/head
jessetang 2 years ago committed by GitHub
parent ae4dd7f4a8
commit 492248d032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      cmd/kratos/internal/project/new.go
  2. 4
      cmd/kratos/internal/proto/client/client.go
  3. 4
      cmd/kratos/internal/proto/proto.go
  4. 4
      cmd/kratos/internal/upgrade/upgrade.go
  5. 4
      cmd/kratos/main.go

@ -6,10 +6,10 @@ import (
"os"
"path"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/base"
"github.com/AlecAivazis/survey/v2"
"github.com/fatih/color"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/base"
)
// Project is a project template.
@ -23,11 +23,11 @@ func (p *Project) New(ctx context.Context, dir string, layout string, branch str
to := path.Join(dir, p.Name)
if _, err := os.Stat(to); !os.IsNotExist(err) {
fmt.Printf("🚫 %s already exists\n", p.Name)
override := false
prompt := &survey.Confirm{
Message: "📂 Do you want to override the folder ?",
Help: "Delete the existing folder and create the project.",
}
var override bool
e := survey.AskOne(prompt, &override)
if e != nil {
return e

@ -8,9 +8,9 @@ import (
"regexp"
"strings"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/base"
"github.com/spf13/cobra"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/base"
)
// CmdClient represents the source command.

@ -1,11 +1,11 @@
package proto
import (
"github.com/spf13/cobra"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/proto/add"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/proto/client"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/proto/server"
"github.com/spf13/cobra"
)
// CmdProto represents the proto command.

@ -3,9 +3,9 @@ package upgrade
import (
"fmt"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/base"
"github.com/spf13/cobra"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/base"
)
// CmdUpgrade represents the upgrade command.

@ -3,13 +3,13 @@ package main
import (
"log"
"github.com/spf13/cobra"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/change"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/project"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/proto"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/run"
"github.com/go-kratos/kratos/cmd/kratos/v2/internal/upgrade"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{

Loading…
Cancel
Save