1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

Update run.go (#2025)

This commit is contained in:
songzhibin97 2022-05-22 09:46:05 +08:00 committed by GitHub
parent c1dbc2dbd3
commit bbb96f1e1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,14 +38,15 @@ func Run(cmd *cobra.Command, args []string) {
fmt.Fprintf(os.Stderr, "\033[31mERROR: %s\033[m\n", err)
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")
return
} else if len(cmdPath) == 1 {
case 1:
for _, v := range cmdPath {
dir = v
}
} else {
default:
var cmdPaths []string
for k := range cmdPath {
cmdPaths = append(cmdPaths, k)