2.3.0 • Published 7 years ago

@jeanremidelteil/google-apps-script v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

gas, for locally developing Google Apps Script projects

npm GitHub stars NPM Downloads Known Vulnerabilities David Codacy Badge

Installation

$ npm i -g google-apps-script

Usage

Authenticate the Drive API:
(Add '-f' to force reauthentication)

$ gas auth [-f]

Create, delete or rename a project in your Google Drive:

$ gas create <projectName>
$ gas delete <projectName|projectId>
$ gas rename <projectName|projectId> <newProjectName>

List your remote projects and their id's (optional filter on projectName):

$ gas list [filter]

Link a remote project to your current working directory:

$ gas link <projectName|projectId>

Pull and push code from/to your remote project:
(Files in local folders are mapped to their full path name in a project and the other way around)
(You can specify to pull or push only a single file by adding a filename to the command)

$ gas pull [fileName]
$ gas push [fileName]

Some shortcuts for creating, linking and pulling projects all in one:

$ gas init <name>
$ gas clone <projectName|projectId>

Open the linked project or a specified project in the online editor:

$ gas open [projectName|projectId]

Show some info about the linked project or a specified project:

$ gas show [projectName|projectId]

Check if there are any differences between your local files and Google Drive:

$ gas status

There is also the beta feature of including specified external files

// Content of gas-include.js
'time.js' - 'https://raw.githubusercontent.com/MaartenDesnouck/google-apps-script-include/master/Time.js'

$ gas include
$ gas push

Examples

$ gas init myScript
$ cd myScript
$ gas open
$ gas list
$ gas clone myScript
$ gas create myScript2
$ mkdir src
$ cd src
$ gas link myScript2
$ gas info
$ gas pull

.gitignore

Gas creates some extra files in a .gas folder of which only 'ID' should be checked into git,
so a .gitignore file gets added to your project if there isn't one present yet.

Suggestions or questions? Tweet me @MaartenDesnouck or create an issue on github.