Skip to content

Commit

Permalink
修复嵌套文件夹上传路径错误 (#35)
Browse files Browse the repository at this point in the history
Co-authored-by: huaihuai <[email protected]>
  • Loading branch information
konwa and huaihuai0406 authored Nov 29, 2022
1 parent 026da72 commit 252b613
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/command_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func (r *CommandUpload) upload(file string, driveID string, fileID string) error
log.Fatal(err)
}
response, err := r.cli.ali.File.CreateFolder(context.Background(), &aliyundrive.CreateFolderReq{
DriveID: r.cli.driveID,
ParentFileID: r.cli.currentFileID,
DriveID: driveID,
ParentFileID: fileID,
Name: fileInfo.Name(),
})
if err != nil {
Expand All @@ -92,6 +92,9 @@ func (r *CommandUpload) upload(file string, driveID string, fileID string) error
}
fmt.Printf("%s 上传成功.\n", filepath.Join(file, subFile.Name()))
}
if err := r.cli.checkoutToParentDir(); err != nil {
return err
}
}
return nil
}

0 comments on commit 252b613

Please sign in to comment.