Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should Google App Scripts be stored in version control like GitHub [closed]

I am confused about the best way to manage shared development of Google App Scripts. The thing is that editing google app scripts is done through an online editor with its own version control in place, but that's not shared with other developers as far as I can tell.

So is the suggested practice that we copy and paste from that editing space into local hard files and then push into the version control system of our choice, and then when we want to test things we copy and paste things back into the online editor? Seems messy and error prone.

I see some people are putting their Google App Scripts in places like Github:

https://github.com/peterneubauer/neo4j-google-apps-script

Would be great it we could push directly from git to deploy on Google App Scripts the same way we do with Heroku. Would really like to be able to run a battery of unit tests against my App Scripts ...

like image 327
Sam Joseph Avatar asked Oct 03 '12 16:10

Sam Joseph


People also ask

Is Google Appscript JavaScript?

Google Apps Script is a rapid application development platform that makes it fast and easy to create business applications that integrate with Google Workspace. You write code in modern JavaScript and have access to built-in libraries for favorite Google Workspace applications like Gmail, Calendar, Drive, and more.

Is JavaScript same as Google script?

Apps Script is essentially JavaScript. It's based on a slightly earlier version of JavaScript, so in effect, it's like JavaScript without some of the newer syntax. If you know Apps Script, it would require relatively little effort to make the bridge to the latest and greatest JavaScript.

What is a library in Google Apps Script?

A library is a script project whose functions can be reused in other scripts. Warning: A script that uses a library doesn't run as quickly as it would if all the code were contained within a single script project.


2 Answers

You can star issue 217 and issue 1959 if that is important to you.

Update: Take a look at Advanced Development Process with Apps Script

like image 77
Jacobvdb Avatar answered Oct 08 '22 18:10

Jacobvdb


Here is how I did. I used the command line tool, gdcmdtools, to import and export my GAS project.
And stored the exported project in github.
Example:

  • gdget.py FILE_ID -f json # down files associated with GAS project with id FIELD_ID, you will get PROJECT_NAME.json and the source files.

  • store the files to version control, like: github.

  • gdput.py -t gas PROJECT_NAME.json # update GAS project with project file 'PROJECT_NAME.json'

For more information, check Manage-Google-Apps-Script(GAS)-with-gdcmdtools

like image 31
tfchen Avatar answered Oct 08 '22 20:10

tfchen