| 428 | } |
| 429 | |
| 430 | func resolveDestination(dbx filesClient, src, dst string, dstIsDir bool) string { |
| 431 | if dstIsDir { |
| 432 | return path.Join("/", dst, filepath.Base(src)) |
| 433 | } |
| 434 | meta, err := dbx.GetMetadataContext(currentContext(), files.NewGetMetadataArg(dst)) |
| 435 | if err != nil { |
| 436 | return dst |
| 437 | } |
| 438 | if _, ok := meta.(*files.FolderMetadata); ok { |
| 439 | return path.Join("/", dst, filepath.Base(src)) |
| 440 | } |
| 441 | return dst |
| 442 | } |
| 443 | |
| 444 | func parsePutOptions(cmd *cobra.Command) (putOptions, error) { |
| 445 | chunkSize, err := cmd.Flags().GetInt64("chunksize") |