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 ...
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.
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.
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.
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
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.
For more information, check Manage-Google-Apps-Script(GAS)-with-gdcmdtools
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With