Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

drive: fix --drive-root-folder-id with team/shared drives

Nick Craig-Wood19229b121567
diff --git a/backend/drive/drive.go b/backend/drive/drive.go
index cc8185395..4aa82214e 100644
--- a/backend/drive/drive.go
+++ b/backend/drive/drive.go
@@ -1021,11 +1021,11 @@ func NewFs(name, path string, m configmap.Mapper) (fs.Fs, error) {
}
// set root folder for a team drive or query the user root folder
- if f.isTeamDrive {
- f.rootFolderID = f.opt.TeamDriveID
- } else if opt.RootFolderID != "" {
+ if opt.RootFolderID != "" {
// override root folder if set or cached in the config
f.rootFolderID = opt.RootFolderID
+ } else if f.isTeamDrive {
+ f.rootFolderID = f.opt.TeamDriveID
} else {
// Look up the root ID and cache it in the config
rootID, err := f.getRootID()