From 3d2139d59df89d65874bb6139b6b33867f1d8b96 Mon Sep 17 00:00:00 2001 From: Allen Zhong Date: Tue, 13 Apr 2021 12:51:32 +0800 Subject: [PATCH] cmd/mirror: format versions for `clone` subcmd --- cmd/mirror.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/mirror.go b/cmd/mirror.go index cb6d1bed45..5bbad0692f 100644 --- a/cmd/mirror.go +++ b/cmd/mirror.go @@ -831,7 +831,17 @@ func newMirrorCloneCmd() *cobra.Command { return spec.TiDBComponentVersion(comp, "") } - return repository.CloneMirror(repo, components, versionMapper, args[0], args[1:], options) + // format input versions + versionList := make([]string, 0) + for _, ver := range args[1:] { + v, err := utils.FmtVer(ver) + if err != nil { + return err + } + versionList = append(versionList, v) + } + + return repository.CloneMirror(repo, components, versionMapper, args[0], versionList, options) }, }