Skip to content

Commit

Permalink
fix the download to path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bachue committed Oct 29, 2024
1 parent 1666cc4 commit 8e5de54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -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=<Link> --to=<ToPath>",
Use: "share-cp <Link> --to=<ToPath>",
Short: "Copy shared files",
Run: func(cmd *cobra.Command, args []string) {
cfg.CmdCfg.CmdId = docs.ShareCpType
Expand Down
2 changes: 1 addition & 1 deletion iqshell/storage/object/operations/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8e5de54

Please sign in to comment.