From 8e5de5440597c48951c9cea4a9941e72e7b1dcf9 Mon Sep 17 00:00:00 2001 From: Rong Zhou Date: Tue, 29 Oct 2024 12:40:55 +0000 Subject: [PATCH] fix the download to path bug --- cmd/share.go | 2 +- iqshell/storage/object/operations/share.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/share.go b/cmd/share.go index 2d6531a9..eb02b31b 100644 --- a/cmd/share.go +++ b/cmd/share.go @@ -60,7 +60,7 @@ var listShareCmdBuilder = func(cfg *iqshell.Config) *cobra.Command { var copyShareCmdBuilder = func(cfg *iqshell.Config) *cobra.Command { var info = operations.CopyShareInfo{} var cmd = &cobra.Command{ - Use: "share-cp --link= --to=", + Use: "share-cp --to=", Short: "Copy shared files", Run: func(cmd *cobra.Command, args []string) { cfg.CmdCfg.CmdId = docs.ShareCpType diff --git a/iqshell/storage/object/operations/share.go b/iqshell/storage/object/operations/share.go index 852a092b..eef4ac65 100644 --- a/iqshell/storage/object/operations/share.go +++ b/iqshell/storage/object/operations/share.go @@ -411,7 +411,7 @@ func copyShare(cfg *iqshell.Config, info *CopyShareInfo) error { } else { downloadPath := toPath if strings.HasSuffix(downloadPath, string(filepath.Separator)) { - offset := strings.LastIndex(downloadPath, "/") + offset := strings.LastIndex(fromPrefix, "/") downloadPath += fromPrefix[(offset + 1):] } if err = os.MkdirAll(filepath.Dir(downloadPath), 0700); err != nil {