MCPcopy Create free account
hub / github.com/dropbox/dbxcli / resolveDestination

Function resolveDestination

cmd/put.go:430–442  ·  view source on GitHub ↗
(dbx filesClient, src, dst string, dstIsDir bool)

Source from the content-addressed store, hash-verified

428}
429
430func 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
444func parsePutOptions(cmd *cobra.Command) (putOptions, error) {
445 chunkSize, err := cmd.Flags().GetInt64("chunksize")

Calls 2

currentContextFunction · 0.85
GetMetadataContextMethod · 0.65