A small tool to sync your Google Apps Script files. Once downloaded you are able to manage the JavaScript files with a proper version control tool.
NOTE: This tool is a work in progress and not working properly yet!
First, you need to enable the Drive API for your app. You can do this in your app's API project in the Google APIs Console.
- Create an API project in the Google APIs Console.
- Select the Services tab in your API project, and enable the Drive API.
- Select the API Access tab in your API project, and click Create an OAuth 2.0 client ID.
- In the Branding Information section, provide a name for the application (e.g. "Google Apps Script Project Manager"), and click Next.
- In the Client ID Settings section, do the following:
- Select Installed application for the Application type
- Select Other for the Installed application type.
- Click Create Client ID.
- In the API Access page, locate the section Client ID for installed applications, and click "Download JSON" and save the file as
client_secrets.json
in app directory.
Alternatively to step 6 you can also copy the file client_secrets.json.sample
and provide your credentials manually.
Use Bundler to install the required gems:
$ bundle install
Running the script will download all your GAS projects and store their files in in separate folders underneath projects/
:
$ ruby gaspm.rb
# ...
$ tree ./projects
projects
|-- project_1
| `-- Code.js
`-- project_2
|-- Code.js
|-- Helper.js
`-- Models.js
Let us know on GitHub when you stumble upon any bugs or issues! Of course, any ideas on improving this tool are most welcome.
If you want to contribute directly by implementing fixes or enhancements, just create a pull request!
MIT License. See LICENSE for details.