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

fix(cmd): modify the problem of getting length error of kratos run command array (#1150)

This commit is contained in:
包子 2021-07-04 21:45:15 +08:00 committed by GitHub
parent a7a8d5d91a
commit 1ef817507a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,10 +39,10 @@ func Run(cmd *cobra.Command, args []string) {
fmt.Fprintf(os.Stderr, "\033[31mERROR: %s\033[m\n", err)
return
}
if len(cmdDir) == 0 {
if len(cmdPath) == 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(cmdDir) == 1 {
} else if len(cmdPath) == 1 {
dir = path.Join(cmdDir, cmdPath[0])
} else {
prompt := &survey.Select{