aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Rasmussen2016-01-24 23:19:42 +0100
committerPetter Rasmussen2016-01-24 23:19:42 +0100
commit625d65cd145a1c392a7c5a7968d738d8dc55c75b (patch)
treea12fdb6b7f400f68daae7c124533d7b15edc897c
parent04a48c8ea2dbf9a3aaaa845f6cec3b5103dcf12a (diff)
downloadgdrive-625d65cd145a1c392a7c5a7968d738d8dc55c75b.tar.bz2
Copy and update given args
-rw-r--r--drive/download.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/drive/download.go b/drive/download.go
index 9434ca6..468f96f 100644
--- a/drive/download.go
+++ b/drive/download.go
@@ -108,20 +108,16 @@ func (self *Drive) downloadDirectory(parent *drive.File, args DownloadArgs) erro
return fmt.Errorf("Failed listing files: %s", err)
}
- // Update download path
- path := filepath.Join(args.Path, parent.Name)
+ newPath := filepath.Join(args.Path, parent.Name)
for _, f := range fileList.Files {
- err = self.download(DownloadArgs{
- Out: args.Out,
- Id: f.Id,
- Progress: args.Progress,
- Force: args.Force,
- Path: path,
- Recursive: args.Recursive,
- Stdout: false,
- })
+ // Copy args and update changed fields
+ newArgs := args
+ newArgs.Path = newPath
+ newArgs.Id = f.Id
+ newArgs.Stdout = false
+ err = self.download(newArgs)
if err != nil {
return err
}