Update run.go (#2025)

pull/2032/head
songzhibin97 3 years ago committed by GitHub
parent c1dbc2dbd3
commit bbb96f1e1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      cmd/kratos/internal/run/run.go

@ -38,14 +38,15 @@ func Run(cmd *cobra.Command, args []string) {
fmt.Fprintf(os.Stderr, "\033[31mERROR: %s\033[m\n", err) fmt.Fprintf(os.Stderr, "\033[31mERROR: %s\033[m\n", err)
return return
} }
if len(cmdPath) == 0 { switch len(cmdPath) {
case 0:
fmt.Fprintf(os.Stderr, "\033[31mERROR: %s\033[m\n", "The cmd directory cannot be found in the current directory") fmt.Fprintf(os.Stderr, "\033[31mERROR: %s\033[m\n", "The cmd directory cannot be found in the current directory")
return return
} else if len(cmdPath) == 1 { case 1:
for _, v := range cmdPath { for _, v := range cmdPath {
dir = v dir = v
} }
} else { default:
var cmdPaths []string var cmdPaths []string
for k := range cmdPath { for k := range cmdPath {
cmdPaths = append(cmdPaths, k) cmdPaths = append(cmdPaths, k)

Loading…
Cancel
Save