(cmd *cobra.Command, args []string)
| 345 | } |
| 346 | |
| 347 | func fileCpRun(cmd *cobra.Command, args []string) error { |
| 348 | src, dst := args[0], args[1] |
| 349 | merge, err := cmd.Flags().GetBool("merge") |
| 350 | if err != nil { |
| 351 | return err |
| 352 | } |
| 353 | force, err := cmd.Flags().GetBool("force") |
| 354 | if err != nil { |
| 355 | return err |
| 356 | } |
| 357 | |
| 358 | srcPath, err := fixRelativePaths(src) |
| 359 | if err != nil { |
| 360 | return fmt.Errorf("unable to parse src path: %w", err) |
| 361 | } |
| 362 | |
| 363 | _, err = checkFileSize(srcPath, MaxFileSize) |
| 364 | if err != nil { |
| 365 | return err |
| 366 | } |
| 367 | |
| 368 | destPath, err := fixRelativePaths(dst) |
| 369 | if err != nil { |
| 370 | return fmt.Errorf("unable to parse dest path: %w", err) |
| 371 | } |
| 372 | log.Printf("Copying %s to %s; merge: %v, force: %v", srcPath, destPath, merge, force) |
| 373 | rpcOpts := &wshrpc.RpcOpts{Timeout: TimeoutYear} |
| 374 | err = wshclient.FileCopyCommand(RpcClient, wshrpc.CommandFileCopyData{SrcUri: srcPath, DestUri: destPath, Opts: &wshrpc.FileCopyOpts{Merge: merge, Overwrite: force, Timeout: TimeoutYear}}, rpcOpts) |
| 375 | if err != nil { |
| 376 | return fmt.Errorf("copying file: %w", err) |
| 377 | } |
| 378 | return nil |
| 379 | } |
| 380 | |
| 381 | func fileMvRun(cmd *cobra.Command, args []string) error { |
| 382 | src, dst := args[0], args[1] |
nothing calls this directly
no test coverage detected