diff --git a/README.md b/README.md index d27e06f7..2d65fa6c 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ Optionally set the `GOOGLE_API_CLIENT_ID` and `GOOGLE_API_CLIENT_SECRET` environ ### Hyphens: - vs -- -A single hypen `-` can be used to specify options. However two hypens `--` can be used with any options in the provided examples below. +A single hyphen `-` can be used to specify options. However two hyphens `--` can be used with any options in the provided examples below. ### Initializing @@ -198,7 +198,7 @@ The opposite of `drive init`, it will remove your credentials locally as well as drive deinit [-no-prompt] ``` -For a complete deinit-ialization, don't forget to revoke account access, [please see revoking account access](#revoking-account-access) +For a complete deinitialization, don't forget to revoke account access, [please see revoking account access](#revoking-account-access) ### Traversal Depth @@ -1420,10 +1420,10 @@ Background sync is not just hard, it is stupid. Here are my technical and philos ## Known Issues -* It probably doesn't work on Windows. -* Google Drive allows a directory to contain files/directories with the same name. Client doesn't handle these cases yet. We don't recommend you to use `drive` if you have such files/directories to avoid data loss. -* Racing conditions occur if remote is being modified while we're trying to update the file. Google Drive provides resource versioning with ETags, use Etags to avoid racy cases. +* Race conditions occur if remote is being modified while we're trying to update the file. Google Drive provides resource versioning with ETags, use Etags to avoid racy cases. * drive rejects reading from namedPipes because they could infinitely hang. See [issue #208](https://github.com/odeke-em/drive/issues/208). +* It is unsupported on Windows. Some functionality works but it has not been thoroughly tested. +* Google Drive allows a directory to contain files/directories with the same name. Client doesn't handle these cases gracefully but can offer to 'fix clashes'. See #detecting-and-fixing-clashes . We don't recommend you to use `drive` if you have such files/directories to avoid data loss. ## Reaching Out diff --git a/cmd/drive/main.go b/cmd/drive/main.go index c2bda6da..0d1f7ef5 100644 --- a/cmd/drive/main.go +++ b/cmd/drive/main.go @@ -2057,6 +2057,10 @@ func relativePathsOpt(root string, args []string, leastNonExistant bool) ([]stri relPath = "" } + // This function appears to be meant to return server-side (/-separated) paths. + // But its input is client side (maybe / or \) separted paths. + // filepath.ToSlash fixes that. + relPath = filepath.ToSlash(relPath) relPath = "/" + relPath relPaths = append(relPaths, relPath) } diff --git a/config/config.go b/config/config.go index 8a150445..8a0ac8e4 100644 --- a/config/config.go +++ b/config/config.go @@ -299,7 +299,7 @@ func (c *Context) DeInitialize(prompter func(...interface{}) bool, returnOnAnyEr } for _, p := range pathsToRemove { - if !prompter("remove: ", p, ". This operation is permanent (Y/N) ") { + if !prompter("remove: ", p, ". This operation is permanent (Y/n) ") { continue } diff --git a/src/clashes.go b/src/clashes.go index 57c3bec7..70cdce8c 100644 --- a/src/clashes.go +++ b/src/clashes.go @@ -274,7 +274,7 @@ func autoRenameClashes(g *Commands, clashes []*Change) error { for _, r := range renames { g.log.Logf("%v %v -> %v\n", r.originalPath, r.change.Src.Id, r.newName) } - status := promptForChanges("Proceed with the changes [Y/N] ? ") + status := promptForChanges("Proceed with the changes [Y/n] ? ") if !accepted(status) { return ErrClashFixingAborted } diff --git a/src/misc.go b/src/misc.go index 7316c410..5ccdffe6 100644 --- a/src/misc.go +++ b/src/misc.go @@ -321,7 +321,7 @@ func nextPage() bool { func promptForChanges(args ...interface{}) Agreement { argv := []interface{}{ - "Proceed with the changes? [Y/n]:", + "Proceed with the changes? [Y/n]: ", } if len(args) >= 1 { argv = args diff --git a/src/remote.go b/src/remote.go index b39bd945..eebfa02c 100644 --- a/src/remote.go +++ b/src/remote.go @@ -1096,8 +1096,14 @@ func (r *Remote) findByPathRecvRawM(parentId string, p []string, trashed bool) * working = false break } + if f != nil { chanOChan <- r.findByPathRecvRawM(f.Id, rest, trashed) + } else { + // Ensure that we properly send + // back nil even if files were not found. + // See https://github.com/odeke-em/drive/issues/933. + chanOChan <- wrapInPaginationPair(nil, nil) } } } diff --git a/src/trash.go b/src/trash.go index 1883840f..b3b63750 100644 --- a/src/trash.go +++ b/src/trash.go @@ -234,7 +234,7 @@ func (g *Commands) reduceForTrash(args []string, opt *trashOpt) error { } if opt.permanent && g.opts.canPrompt() { - status := promptForChanges("This operation is irreversible. Continue [Y/N] ") + status := promptForChanges("This operation is irreversible. Continue [Y/n] ") if !accepted(status) { return status.Error() }