Skip to content

Commit

Permalink
Updated to v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tanaikech committed Jan 24, 2018
1 parent 126d0f6 commit 4a9241f
Show file tree
Hide file tree
Showing 15 changed files with 1,268 additions and 329 deletions.
59 changes: 43 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ Will you want to develop GAS on your local PC? Generally, when we develop GAS, w

Features of "ggsrun" are as follows.

1. **[Develops GAS using your terminal and text editor which got accustomed to using.](help/README.md#demoterminal)**
1. **[Develops GAS using your local terminal and text editor which got accustomed to using.](help/README.md#demoterminal)**<sup><font color="Red">Updated! (v1.4.0)</font></sup>
1. **[Executes GAS by giving values to your script.](help/README.md#givevalues)**
1. **[Executes GAS made of CoffeeScript.](help/README.md#coffee)**
1. **[Downloads spreadsheet, document and presentation, while executes GAS, simultaneously.](help/README.md#filedownload)**
1. **[Creates, updates and backs up project with GAS.](help/README.md#fileupdate)**
1. **[Downloads files from Google Drive and Uploads files to Google Drive.](help/README.md#fileupdown)**
1. **[Downloads standalone script and bound script.](help/README.md#DownloadBoundScript)**
1. **[Rearranges scripts in project.](help/README.md#rearrangescripts)** <sup><font color="Red">NEW! (v1.3.2)</font></sup>
1. **[Modifies Manifests in project.](help/README.md#ModifyManifests)** <sup><font color="Red">NEW! (v1.3.3)</font></sup>
1. **[Downloads standalone script and bound script.](help/README.md#DownloadFiles)** <sup><font color="Red">Updated! (v1.4.0)</font></sup>
1. **[Upload script files and create project as standalone script and container-bound script.](help/README.md#UploadFiles)** <sup><font color="Red">Updated! (v1.4.0)</font></sup>
1. **[Update project.](help/README.md#Update_Project)** <sup><font color="Red">Updated! (v1.4.0)</font></sup>
1. **[Retrieve revision files of Google Docs and retrieve versions of projects.](help/README.md#RevisionFile)** <sup><font color="Red">Updated! (v1.4.0)</font></sup>
1. **[Rearranges scripts in project.](help/README.md#rearrangescripts)** <sup><font color="Red">Updated! (v1.4.0)</font></sup>
1. **[Modifies Manifests in project.](help/README.md#ModifyManifests)**

<a name="How_to_Install"></a>
# How to Install
Expand All @@ -42,18 +44,32 @@ Use go get.
$ go get -u github.com/tanaikech/ggsrun
~~~

<a name="BasicSettingFlow"></a>
## 2. Basic setting flow
When you click each link of title, you can see the detail information.

1. [Setup ggsrun Server (at Google side)](help/README.md#Setup_ggsrun_Server)
- Create new project and install the server as a library.
- Script ID of the library is "**``115-19njNHlbT-NI0hMPDnVO1sdrw2tJKCAJgOTIAPbi_jq3tOo4lVRov``**".
- **<u>After installed the library, please push the save button at the script editor.</u>** This is important! By this, the library is completely reflected.
1. [Install Google Apps Script API(Execution API)](help/README.md#Install_Execution_API)
- For the created project, deploy API executable.
- Enable **[Google Apps Script API(Execution API)](https://console.cloud.google.com/apis/library/script.googleapis.com/)** and **[Drive API](https://console.cloud.google.com/apis/api/drive.googleapis.com/)** at API console.
- [Deploy API executable](https://developers.google.com/apps-script/api/how-tos/execute#step_1_deploy_the_script_as_an_api_executable). Choose "Only myself" as "Who has access to the script"
- [Install the server as a library.](https://developers.google.com/apps-script/guides/libraries#managing_libraries) Script ID of the library is "**``115-19njNHlbT-NI0hMPDnVO1sdrw2tJKCAJgOTIAPbi_jq3tOo4lVRov``**".
- **<u>After installed the library, please push the save button at the script editor.</u>** This is very important! By this, the library is completely reflected.
1. [Get Client ID, Client Secret](help/README.md#GetClientID)
- Create a credential as **Other** and download **``client_secret.json``**.
- On the Script Editor
- Resources -> Cloud Platform Project
- Click the lower part of "This script is currently associated with project:"
- In "Getting Started", Click "Enable APIs and get credentials like keys".
- On "API APIs&services"
- Click "Credentials" at left side.
- At "Create Credentials", Click OAuth client ID.
- Choose **Other**
- Input Name (This is a name you want.)
- done
- Download a JSON file with Client ID and Client Secret as **``client_secret.json``** using download button.
1. [Enable APIs](help/README.md#Install_Execution_API)
- ggsrun uses Google Apps Script API and Drive API. Please enable them at API console. You can directly access them as follows. Project ID can be seen at downloaded ``client_secret.json``.
- ``https://console.cloud.google.com/apis/library/script.googleapis.com/?project=### project ID ###``
- **Also here [https://script.google.com/home/usersettings](https://script.google.com/home/usersettings) has to be enabled. Please turn ON.**
- ``https://console.cloud.google.com/apis/api/drive.googleapis.com/?project=### project ID ###``
1. [Create configure file for ggsrun](help/README.md#Createconfigurefile)
- Run ``$ ggsrun auth`` at the directory with ``client_secret.json``.
1. [Test Run](help/README.md#Runggsrun)
Expand All @@ -62,22 +78,33 @@ When you click each link of title, you can see the detail information.

Congratulation! You got ggsrun!

<a name="from134to140"></a>
# To users which are using ggsrun with v1.3.4 and/or less <sup><font color="Red">Updated! (v1.4.0)</font></sup>
Please reauthorize to include a new scope to the access token as follows.

1. Confirm whether Google Apps Script API is enabled. You can directly access it as follows. Project ID can be seen at the downloaded ``client_secret.json``.
- ``https://console.cloud.google.com/apis/library/script.googleapis.com/?project=### project ID ###``
- Also here [https://script.google.com/home/usersettings](https://script.google.com/home/usersettings) has to be enabled. Please turn ON.
1. Add a scope of ``https://www.googleapis.com/auth/script.projects`` to ``ggsrun.cfg``.
1. Run the following command under the directory with ``client_secret.json`` and ``ggsrun.cfg``.
- ``$ ggsrun auth``

Completed!

# How to use ggsrun
1. [Executes GAS and Retrieves Result Values](help/README.md#ExecutesGASandRetrievesResultValues)
1. [Executes GAS with Values and Retrieves Feedbacked Values](help/README.md#ExecutesGASwithValuesandRetrievesFeedbackedValues)
1. [For Debug](help/README.md#ForDebug)
1. [Executes GAS with Values and Downloads File](help/README.md#ExecutesGASwithValuesandDownloadsFile)
1. [Executes Existing Functions on Project](help/README.md#ExecutesExistingFunctionsonProject)
1. [Download Files](help/README.md#DownloadFiles)
1. [How to Download Container-Bound Scripts](help/README.md#DownloadBoundScript) <sup><font color="Red">NEW! (v1.3.4)</font></sup>

1. [Upload Files](help/README.md#UploadFiles)
1. [Show File List](help/README.md#ShowFileList)
1. [Search Files](help/README.md#SearchFiles)
1. [Update Project](help/README.md#Update_Project)
1. [Retrieve Revision Files](help/README.md#RevisionFile)
1. [Rearrange Script in Project](help/README.md#rearrangescripts) <sup><font color="Red">NEW! (v1.3.2)</font></sup>
1. [Modify Manifests](help/README.md#ModifyManifests) <sup><font color="Red">NEW! (v1.3.3)</font></sup>
1. [Retrieve Revision Files and Versions of Projects](help/README.md#RevisionFile)
1. [Rearrange Script in Project](help/README.md#rearrangescripts)
1. [Modify Manifests](help/README.md#ModifyManifests)

# Applications
1. [For Sublime Text](help/README.md#demosublime)
Expand Down
19 changes: 14 additions & 5 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,24 @@ Will you want to develop GAS on your local PC? Generally, when we develop GAS, w
4. Downloads spreadsheet, document and presentation, while executes GAS, simultaneously.
5. Creates, updates and backs up project with GAS.
5. Upload files to Google Drive. When files are uploaded, also they can be converted by options.
6. Downloads files from Google Drive and Uploads files to Google Drive. Also container-bound scripts can be downloaded.
6. Creates, updates and backs up project of both standalone type and bound script type.
7. Download revision files from Google Drive.
7. Creates Google Docs (Spreadsheet, Document, Slide and Form) and create bound script in the created Google Docs.
8. Rearranges scripts in project.
8. Downloads files from Google Drive and Uploads files to Google Drive. Also container-bound scripts can be downloaded.
9. Downloads revision files from Google Drive.
10. Rearranges files in project of both standalone type and bound script type.
11. Modifies Manifests (appsscript.json) in project.
12. Remove files in the project of both standalone type and bound script type.
13. Retrieve revision file list and revision data.
9. Modifies Manifests (appsscript.json) in project.
You can see the release page https://github.com/tanaikech/ggsrun/releases
Expand Down
55 changes: 44 additions & 11 deletions ggsrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func main() {
app.Author = "Tanaike [ https://github.com/tanaikech/ggsrun ] "
app.Email = "[email protected]"
app.Usage = "Executes Google Apps Script (GAS) on Google and Feeds Back Results."
app.Version = "1.3.4"
app.Version = "1.4.0"
app.Commands = []cli.Command{
{
Name: "exe1",
Expand Down Expand Up @@ -155,14 +155,14 @@ func main() {
Name: "filename, f",
Usage: "File Name on Google Drive",
},
cli.StringFlag{
Name: "projectid, pi",
Usage: "Project ID of 'bound scripts' of Google Sheets, Docs, or Forms file. Please use this for downloading 'bound scripts'.",
},
cli.StringFlag{
Name: "boundscriptname, bn",
Usage: "This is used for the option of 'projectid'. Using this option, when you download the 'bound scripts', you can give the filename.",
},
// cli.StringFlag{
// Name: "projectid, pi",
// Usage: "Project ID of 'bound scripts' of Google Sheets, Docs, or Forms file. Please use this for downloading 'bound scripts'.",
// },
// cli.StringFlag{
// Name: "boundscriptname, bn",
// Usage: "This is used for the option of 'projectid'. Using this option, when you download the 'bound scripts', you can give the filename.",
// },
cli.StringFlag{
Name: "extension, e",
Usage: "Extension (File format of downloaded file)",
Expand All @@ -171,6 +171,10 @@ func main() {
Name: "rawdata, r",
Usage: "Save a project with GAS scripts as raw data (JSON data).",
},
cli.StringFlag{
Name: "deletefile",
Usage: "Value is file ID. This can delete a file using a file ID on Google Drive.",
},
cli.BoolFlag{
Name: "jsonparser, j",
Usage: "Display results by JSON parser",
Expand All @@ -186,16 +190,33 @@ func main() {
Flags: []cli.Flag{
cli.StringFlag{
Name: "filename, f",
Usage: "File Name on local PC",
Usage: "File Name on local PC. Please input files you want to upload.",
},
cli.StringFlag{
Name: "parentfolderid, p",
Usage: "Folder ID of parent folder on Google Drive",
},
cli.StringFlag{
Name: "parentid, pid",
Usage: "File ID of Google Docs (Spreadsheet, Document, Slide, Form) for creating container bound-script.",
},
cli.StringFlag{
Name: "timezone, tz",
Usage: "Time zone of project. Please use this together with creating new project. When new project is created by API, time zone doesn't become the local time zone. (This might be a bug.) So please input this.",
},
cli.StringFlag{
Name: "projectname, pn",
Usage: "Upload several GAS scripts as a project.",
},
cli.StringFlag{
Name: "googledocname, gn",
Usage: "Filename of Google Docs which is created.",
},
cli.StringFlag{
Name: "projecttype, pt",
Usage: "You can select where it creates a new project. Please input 'spreadsheet', 'document', 'slide' and 'form'. When you select one of them, new project is created as a bound script. If this option is not used, new project is created as a standalone script. This is a default.",
Value: "standalone",
},
cli.BoolFlag{
Name: "noconvert, nc",
Usage: "If you don't want to convert file to Google Apps format.",
Expand All @@ -215,7 +236,11 @@ func main() {
Flags: []cli.Flag{
cli.StringFlag{
Name: "filename, f",
Usage: "File name. It's source files for updating.",
Usage: "File name. It's source files for updating. When you set files which are not in the project, the files are added to the project. When you set files which are in the project, the files are overwritten to the files with same filename.",
},
cli.BoolFlag{
Name: "deletefiles",
Usage: "When you use this bool flag, projectid and filename, they are removed from the project.",
},
cli.StringFlag{
Name: "projectid, p",
Expand Down Expand Up @@ -254,10 +279,18 @@ func main() {
Name: "download, d",
Usage: "Value is revision ID. Download revision file using it and file ID.",
},
cli.StringFlag{
Name: "createversion, cv",
Usage: "Create new version of GAS project. Please input the description of version as string.",
},
cli.StringFlag{
Name: "extension, e",
Usage: "Extension (File format of downloaded file)",
},
cli.BoolFlag{
Name: "rawdata, r",
Usage: "Save a project with GAS scripts as raw data (JSON data).",
},
cli.BoolFlag{
Name: "jsonparser, j",
Usage: "Display results by JSON parser",
Expand Down
Loading

0 comments on commit 4a9241f

Please sign in to comment.