export: allow unloading to a single directory instead of each sub-directory per export · Issue #660 · odeke-em/drive

@AtcR

I'm trying to pull and export some docs files to pdf (app 900) without make a lot of directories.

drive pull -force -export pdf -exports-dir /home/xxxxxx/gdrive/PDF/ -id xxxxxxx

But each export make his own folder into PDF.
How can i insert each exported file into only one directorie/folder?

I know my English is not perfect and I will really appreciate if you could give me a hand on this problem.

@odeke-em

Hello there @AtcR, thanks for the issue and welcome to drive.

Yes in deed, currently it creates a directory per file but that's because you can export to multiple formats(e.g pdf, txt, rtf, png etc) and also to avoid cluttering one directory. A feature request could be to allow dumping exports into a common directory.

@chevillet

I'd love to have the ability to export files in their original directories even if it clutters them.
Also, it would be great to be able to skip the ".desktop" files when they were exported.

Of course, it shouldn't be the default behaviour and I can live without it but I'd love these options.

@odeke-em odeke-em changed the title Too many directories export: allow unloading to a single directory instead of each sub-directory per export

Jul 23, 2016

odeke-em added a commit that referenced this issue

Jul 23, 2016
Fixes #660.

Allow exporting to same directory and level, instead of:
a) Always dumping exports per exportable file in a sub-directory
called `<filename>_exports`.
This CL allows for users to request that their exports be put in the
same directory with pull flag `--same-exports-dir`.
If `--same-exports-dir` is set, it will place all exports in the same
directory and level.

* Exhibit A:
```shell
 drive pull --explicitly-export --exports-dir ~/Desktop/exp --export
pdf,txt,odt --same-exports-dir
Resolving...
+ /test-exports/few.docs
+ /test-exports/few
+ /test-exports/influx
Addition count 3
Proceed with the changes? [Y/n]:y
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/influx' to '/Users/emmanuelodeke/Desktop/exp/influx.pdf'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/influx' to '/Users/emmanuelodeke/Desktop/exp/influx.txt'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few' to '/Users/emmanuelodeke/Desktop/exp/few.pdf'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs.txt'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs.odt'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs.pdf'
```

* Exhibit B (Original case, _exports suffixed dirs used):
```shell
$ drive pull --explicitly-export --exports-dir ~/Desktop/exp --export
pdf,txt,odt
Resolving...
+ /test-exports/few.docs
+ /test-exports/few
+ /test-exports/influx
Addition count 3
Proceed with the changes? [Y/n]:y
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/influx' to '/Users/emmanuelodeke/Desktop/exp/influx_exports/influx.pdf'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/influx' to '/Users/emmanuelodeke/Desktop/exp/influx_exports/influx.txt'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few' to '/Users/emmanuelodeke/Desktop/exp/few_exports/few.pdf'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs_exports/few.docs.odt'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs_exports/few.docs.txt'
Exported '/Users/emmanuelodeke/emm.odeke@gmail.com/test-exports/few.docs' to '/Users/emmanuelodeke/Desktop/exp/few.docs_exports/few.docs.pdf'
```

@odeke-em

@chevillet thanks for chiming in, actually would you mind filing a separate issue about skipping the creation of *.desktop files?
Otherwise I have a CL coming up in a second to implement this request in this issue.

@chevillet

Hi @odeke-em!
Thanks a lot for this new feature, it's really cool.
And sorry about the *.desktop request, I should have created a different issue in the first place, my bad.

@odeke-em

No worries at all. I see you've created the issue, I am going to get started working on it as we speak 🙏🏾