Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull folders only #670

Closed
brandoncurtis opened this issue Jun 17, 2016 · 4 comments
Closed

Pull folders only #670

brandoncurtis opened this issue Jun 17, 2016 · 4 comments
Assignees
Milestone

Comments

@brandoncurtis
Copy link

I have a Google Drive with a huge, deeply-nested file structure. It is not feasible to store the contents of the Drive locally, and the folder structure is too complicated to keep in my head.

I would like to use drive pull to recreate the entire folder structure locally; then I could navigate the structure in the terminal and pull down individual folders when I need them. Is this possible with the current version of drive?

@odeke-em
Copy link
Owner

Roger that. We could have a flag to just pull directories kind of the way you can specify only files with find . -type f or only directories with find . -type d. This is a useful feature. In fact I think we have it enabled for drive list --files to only list files.

@odeke-em odeke-em self-assigned this Jun 25, 2016
@odeke-em odeke-em added this to the v0.3.8 milestone Jun 25, 2016
odeke-em added a commit that referenced this issue Jun 25, 2016
push and pull now allow for selection of types
e.g only files, only directories using flags
`--files` or `--directories`.

* Pull:
- Exhibit A: No type sifting/selection -- ordinary pull
```shell
 drive pull a1
Resolving...
- /test/a1
- /test/a1/b2
- /test/a1/b2/c3
- /test/a1/b2/c3/d4
- /test/a1/b2/c3/d4/e5
- /test/a1/b2/c3/test.txt
Deletion count 6
Proceed with the changes? [Y/n]:
```

- Exhibit B: only files
```shell
$ drive pull --files a1
Resolving...
- /test/a1/b2/c3/test.txt
Deletion count 1
Proceed with the changes? [Y/n]:
```

- Exhibit C: only directories
```shell
$ drive pull --directories a1
Resolving...
- /test/a1
- /test/a1/b2
- /test/a1/b2/c3
- /test/a1/b2/c3/d4
- /test/a1/b2/c3/d4/e5
Deletion count 5
Proceed with the changes? [Y/n]:
```

- Exhibit D: illogical state, both files and directories
```shell
$ drive pull --directories --files a1
cannot request for both file and folder
```

* Push:
- Exhibit A: No type sifting/selection -- ordinary request
```shell
$ mkdir -p a1/b2/c3/d4/e5 && touch a1/b2/c3/test.txt
$ drive push a1
Resolving...
+ /test/a1
+ /test/a1/b2
+ /test/a1/b2/c3
+ /test/a1/b2/c3/d4
+ /test/a1/b2/c3/d4/e5
+ /test/a1/b2/c3/test.txt
Addition count 6
Proceed with the changes? [Y/n]:
```

- Exhibit B: only files
```shell
$ drive push --files a1
Resolving...
+ /test/a1/b2/c3/test.txt
Addition count 1
Proceed with the changes? [Y/n]:
```

- Exhibit C: only directories
```shell
$ drive push --directories a1
Resolving...
+ /test/a1
+ /test/a1/b2
+ /test/a1/b2/c3
+ /test/a1/b2/c3/d4
+ /test/a1/b2/c3/d4/e5
Addition count 5
Proceed with the changes? [Y/n]:
```

- Exhibit D: illogical state
```shell
$ drive push --directories --files a1
cannot request for both file and folder
```

Fixes #670.
@odeke-em
Copy link
Owner

Hello there @brandoncurtis, thank you for this request.
Please get the latest code and then you'll be able to do

$ drive push --directories a1/m1
$ drive pull --files tf1/tf2

Please see PR #673.

If there are any issues, feel free to reopen this issue.

@brandoncurtis
Copy link
Author

Brilliant. Works great! Thanks @odeke-em!

@odeke-em
Copy link
Owner

Thanks for checking it out @brandoncurtis and for the kind words :). Good morning!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants