(dbx filesClient, dst string, ifExists string)
| 573 | } |
| 574 | |
| 575 | func checkPutStdinDestination(dbx filesClient, dst string, ifExists string) (putDestinationAction, files.IsMetadata, error) { |
| 576 | ifExists, err := normalizePutIfExists(ifExists) |
| 577 | if err != nil { |
| 578 | return putDestinationUpload, nil, err |
| 579 | } |
| 580 | |
| 581 | meta, exists, err := getDestinationMetadata(dbx, dst) |
| 582 | if err != nil { |
| 583 | if ifExists == putIfExistsOverwrite { |
| 584 | return putDestinationUpload, nil, nil |
| 585 | } |
| 586 | return putDestinationUpload, nil, err |
| 587 | } |
| 588 | if !exists { |
| 589 | return putDestinationUpload, nil, nil |
| 590 | } |
| 591 | if _, ok := meta.(*files.FolderMetadata); ok { |
| 592 | return putDestinationUpload, nil, invalidArgumentsErrorfWithDetails("cannot upload stdin to folder %q; provide a full Dropbox file path", mergeJSONErrorDetails(operationErrorDetails("upload"), pathErrorDetails(dst)), dst) |
| 593 | } |
| 594 | return actionForExistingDestination(dst, ifExists, meta) |
| 595 | } |
| 596 | |
| 597 | func checkPutDestination(dbx filesClient, dst string, ifExists string) (putDestinationAction, files.IsMetadata, error) { |
| 598 | ifExists, err := normalizePutIfExists(ifExists) |
no test coverage detected