You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+2
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ Features of "ggsrun" are as follows.
25
25
1.**[Downloads spreadsheet, document and presentation, while executes GAS, simultaneously.](help/README.md#DownloadFiles)**
26
26
1.**[Downloads files from Google Drive and Uploads files to Google Drive.](help/README.md#UploadFiles)** <sup><fontcolor="Red">Updated! (v1.4.1)</font></sup>
27
27
1.**[Downloads standalone script and bound script.](help/README.md#DownloadFiles)** <sup><fontcolor="Red">Updated! (v1.4.0)</font></sup>
28
+
1.**[Downloads all files and folders in a specific folder.](help/README.md#DownloadFilesFromFolder)** <sup><fontcolor="Red">Updated! (v1.5.0)</font></sup>
28
29
1.**[Upload script files and create project as standalone script and container-bound script.](help/README.md#UploadFiles)** <sup><fontcolor="Red">Updated! (v1.4.0)</font></sup>
1.**[Retrieve revision files of Google Docs and retrieve versions of projects.](help/README.md#RevisionFile)** <sup><fontcolor="Red">Updated! (v1.4.0)</font></sup>
@@ -99,6 +100,7 @@ Completed!
99
100
1.[Executes GAS with Values and Downloads File](help/README.md#ExecutesGASwithValuesandDownloadsFile)
100
101
1.[Executes Existing Functions on Project](help/README.md#ExecutesExistingFunctionsonProject)
101
102
1.[Download Files](help/README.md#DownloadFiles)
103
+
1.[Downloads all files and folders in a specific folder.](help/README.md#DownloadFilesFromFolder)
Copy file name to clipboardexpand all lines: help/README.md
+105-1
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ ggsrun
25
25
- Executes GAS with Values and Downloads File
26
26
- Executes Existing Functions on Project
27
27
- Download Files
28
+
- Download All Files and Folders in Specific Folder
28
29
- Upload Files
29
30
- Show File List
30
31
- Search Files
@@ -69,6 +70,8 @@ Features of "ggsrun" are as follows.
69
70
70
71
1.**[Downloads standalone script and bound script.](#DownloadFiles)**
71
72
73
+
1.**[Downloads all files and folders in a specific folder.](#DownloadFilesFromFolder)**
74
+
72
75
1.**[Upload script files and create project as standalone script and container-bound script.](#UploadFiles)**
73
76
74
77
1.**[Update project.](#Update_Project)**
@@ -890,7 +893,8 @@ $ ggsrun d -f filename -e pdf
890
893
891
894
You can convert only from Google Docs Files (spreadsheet, slide, documentation and so on). For example, you cannot convert image files and text data.
892
895
893
-
When you download project files which are standalone script and container-bound script, you can use the option of ``--raw``. You can download raw files of project by this.
896
+
- When you download project files which are standalone script and container-bound script, you can use the option of ``--raw``. You can download raw files of project by this.
897
+
- When you download a project file, when you use the option ``--zip`` or ``-zip``, you can download the prject as a zip file. This zip file has all scripts in the project. This option was added at v1.5.0.
894
898
895
899
~~~bash
896
900
$ ggsrun d -i fileId -r
@@ -912,6 +916,106 @@ You can also delete files using file ID.
912
916
$ ggsrun d --deletefile [fileId]
913
917
~~~
914
918
919
+
<aname="DownloadFilesFromFolder"></a>
920
+
### 6-1. Download All Files and Folders in Specific Folder
921
+
From version 1.5.0, ggsrun got to be able to download all files and folders in the specific folder in Google Drive. The same folder structure of Google Drive is created to the local PC.
922
+
923
+
**Run :**
924
+
925
+
~~~bash
926
+
$ ggsrun d -f foldername
927
+
~~~
928
+
929
+
or
930
+
931
+
~~~bash
932
+
$ ggsrun d -i folderid
933
+
~~~
934
+
935
+
- When the option ``--jsonparser`` or ``-j `` is used like ``$ ggsrun d -f foldername -j``, you can see the progress of download. Other options are the same with those of download.
936
+
- When the option ``--showfilelist`` or ``-l`` is used, only the file list and folder structure can be retrieved as JSON object. In this case, no files and folders are downloaded.
937
+
- When the option ``--overwrite`` or ``-o`` is used, when the duplicated files in the downloaded folder on the local PC are found, the downloaded files are overwritten.
938
+
- When the option ``--skip`` or ``-s`` is used, when the duplicated files in the downloaded folder on the local PC are found, the downloaded files are skipped and not saved. This can be used to know whether the files with new filename were created in the folder of Google Drive.
939
+
- About the folder, you can download from not only the folders in your Google Drive, but also the shared folders in other Google Drive. When you want to download the files from the shared folder, please use the folder ID of the shared folder.
940
+
- When the files and folders are downloaded, the folder structure in Google Drive is also created to the working directory on the local PC.
941
+
- When the project of the standalone script script type is downloaded, it is created as a zip file. In the zip file, all scripts are included.
942
+
943
+
#### Sample:
944
+

945
+
As a sample, it supposes that it downloads the files from the above structure. The command is as follows.
946
+
947
+
~~~bash
948
+
$ ggsrun d -f sampleFolder1 -j
949
+
~~~
950
+
951
+
By this command, all files with the folder structure ot the above figure are created in the working directory on local PC. When the command is run, the following result is returned. When ``-j`` is not used, only JSON object is returned.
952
+
953
+
~~~bash
954
+
$ ggsrun d -f sampleFolder1 -j
955
+
Files are downloaded from a folder 'sampleFolder1'.
956
+
Getting values to download.
957
+
Download files from a folder 'sampleFolder1'.
958
+
There are 10 files and 6 folders in the folder.
959
+
Starting download.
960
+
Now downloading 'Spreadsheet1.xlsx' (bytes)... 3595
961
+
Now downloading 'Spreadsheet2.xlsx' (bytes)... 3595
962
+
Now downloading 'Spreadsheet4.xlsx' (bytes)... 3595
963
+
Now downloading 'Spreadsheet3.xlsx' (bytes)... 3595
964
+
Now downloading 'Document1.docx' (bytes)... 6097
965
+
Now downloading 'image1.jpg' (bytes)... 958546 / 958546
966
+
Now downloading 'Slides1.pptx' (bytes)... 31733
967
+
Now downloading 'Spreadsheet5.xlsx' (bytes)... 3595
968
+
Project file 'StandaloneProject1.gs' is downloaded.
969
+
Now downloading 'Text1.txt' (bytes)... 50000000 / 50000000
"Files were downloaded from folder 'sampleFolder1'.",
993
+
"File was downloaded as 'Spreadsheet1.xlsx'. Size was 3595 bytes.",
994
+
"File was downloaded as 'Spreadsheet2.xlsx'. Size was 3595 bytes.",
995
+
"File was downloaded as 'Spreadsheet4.xlsx'. Size was 3595 bytes.",
996
+
"File was downloaded as 'Spreadsheet3.xlsx'. Size was 3595 bytes.",
997
+
"File was downloaded as 'Document1.docx'. Size was 6097 bytes.",
998
+
"File was downloaded as 'image1.jpg'. Size was 958546 bytes.",
999
+
"File was downloaded as 'Slides1.pptx'. Size was 31733 bytes.",
1000
+
"File was downloaded as 'Spreadsheet5.xlsx'. Size was 3595 bytes.",
1001
+
"StandaloneProject1.gs has 4 scripts.",
1002
+
"4 scripts in the project were saved as 'StandaloneProject1.gs.zip'.",
1003
+
"File was downloaded as 'Text1.txt'. Size was 50000000 bytes.",
1004
+
"There were 10 files and 6 folders in the folder."
1005
+
],
1006
+
"TotalElapsedTime": 12.345
1007
+
}
1008
+
~~~
1009
+
1010
+
1011
+
> **IMPORTANT :**
1012
+
1013
+
> As a limitation, the project ID of the container-bound script still cannot be retrieved using the file ID of Google Docs by Drive API and Apps Script API. By this situation, only the projects of the container-bound script type cannot be downloaded. When the container-bound script can be retrieved from file ID of Google Docs, the backup of folder will be completely done.
1014
+
1015
+
> I have already reported about this situation at [https://issuetracker.google.com/issues/111149037](https://issuetracker.google.com/issues/111149037).
1016
+
1017
+
1018
+
915
1019
<aname="UploadFiles"></a>
916
1020
## 7. Upload Files
917
1021
ggsrun can upload local files to Google Drive. The files also include GAS projects and scripts.
Copy file name to clipboardexpand all lines: help/UpdateHistory.md
+12-1
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ ggsrun
26
26
- If the environment variable (**``GGSRUN_CFG_PATH``**) is set, ggsrun.cfg is read using it.
27
27
- If it is not set, ggsrun.cfg is read from the current working directory. This is as has been the way until now.
28
28
- This is the response for some requests.
29
-
- This incofmation was added to [here](help/README.md#environmentvariable).
29
+
- This information was added to [here](help/README.md#environmentvariable).
30
30
31
31
* v1.2.2 (July 12, 2017)
32
32
@@ -110,6 +110,17 @@ ggsrun
110
110
-``$ ggsrun u -f filename -chunk 10``
111
111
- This means that a file with filename is uploaded by each chunk of 10 MB.
112
112
113
+
* v1.5.0 (October 27, 2018)
114
+
1.[From this version, ggsrun got to be able to download all files and folders in the specific folder in Google Drive.](README.md#DownloadFilesFromFolder) When all files are downloaded from a folder, the same folder structure of Google Drive is created to the local PC.
115
+
-``$ ggsrun d -f folderName or folderId``
116
+
- When the project file is downloaded, it is downloaded as a zip file. All scripts in the project is put in the zip file.
117
+
- Also when you download a single project, you can use an option ``--zip`` or ``-z``. By this, the downloaded project is saved as a zip file.
118
+
- This new function can be also used for the shared folders. When you want to download the files from the shared folder, please use the folder ID of the shared folder.
119
+
1. The file list with the folder tree in the specific folder got to be able to be retrieved.
120
+
1. When the files are downloaded, the progression got to be able to be seen. When you want to see the progression, please use ``-j`` when you download files and folders.
121
+
1. Files with large size got to be able to be used. In order to download files with large size (several gigabytes), files are saved by chunks.
122
+
1. Some modifications.
123
+
113
124
114
125
**You can read "How to install" at [here](https://github.com/tanaikech/ggsrun/blob/master/README.md#How_to_Install).**
fmt.Printf("\n### This is a automatic input mode.\n### Please follow opened browser, login Google and click authentication.\n### It will move to a manual mode if you wait for 30 seconds under this situation.\n")
0 commit comments