Update run.go (#2025)

status-code-override
songzhibin97 3 years ago committed by chenzhihui
parent 7815e482f3
commit cda3eaadcd
  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