From 1ef817507abecbcdb643d208cd65ecf4ab88f28b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= Date: Sun, 4 Jul 2021 21:45:15 +0800 Subject: [PATCH] fix(cmd): modify the problem of getting length error of kratos run command array (#1150) --- cmd/kratos/internal/run/run.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kratos/internal/run/run.go b/cmd/kratos/internal/run/run.go index ef1b4f332..c10a887e3 100644 --- a/cmd/kratos/internal/run/run.go +++ b/cmd/kratos/internal/run/run.go @@ -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{