mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-05 21:24:44 -06:00
Adds support for GDrive Shared Drives
A shared drive can be accessed via gcd://sharedDriveId@path/to/storage sharedDriveId is optional and if omitted duplicacy stores to the user's drive. This remains backwards compatible with existing drives. E.g. gcd://path/to/storage Note: Shared Drives were previously named Team Drives.
This commit is contained in:
@@ -582,10 +582,14 @@ func CreateStorage(preference Preference, resetPassword bool, threads int) (stor
|
||||
SavePassword(preference, "gcs_token", tokenFile)
|
||||
return gcsStorage
|
||||
} else if matched[1] == "gcd" {
|
||||
driveID := matched[2]
|
||||
if len(driveID) != 0 {
|
||||
driveID = driveID[:len(driveID)-1]
|
||||
}
|
||||
storagePath := matched[3] + matched[4]
|
||||
prompt := fmt.Sprintf("Enter the path of the Google Drive token file (downloadable from https://duplicacy.com/gcd_start):")
|
||||
tokenFile := GetPassword(preference, "gcd_token", prompt, true, resetPassword)
|
||||
gcdStorage, err := CreateGCDStorage(tokenFile, storagePath, threads)
|
||||
gcdStorage, err := CreateGCDStorage(tokenFile, driveID, storagePath, threads)
|
||||
if err != nil {
|
||||
LOG_ERROR("STORAGE_CREATE", "Failed to load the Google Drive storage at %s: %v", storageURL, err)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user