Integrating StarRez and G Suite using Google Apps Script.
Several solutions are divided into folders, based on the Google product they integrate with.
- Run
git --version
to ensure git is installed, or download and install git. - Run
npm -v
to ensure npm is installed, or download and install Node.js and npm. - Navigate to the local directory where you will store the project folder.
- Run
git clone https://github.com/avb100/starrez-google-scripts
- Run
cd starrez-google-scripts
to enter the directory you just cloned. - Run
npm install
to install dependencies. This may require additional privileges. - Run
npm run setup
. This will automate several preliminary steps and launch the web app for configuration. - Go to Google Scripts, open the project, and run the doGet() function in
webapp.gs
. This will prompt you to authorize the application to access the neccessary portions of your Google account. - Copy or rename
GoogleDocs/triggerable.example.js
toGoogleDocs/triggerable.js
and set up triggers!
npm run update
will use git and clasp to perform the following steps:
- Pull all files from your Google Apps Script project to your local copy. (
clasp pull
) - Overwrite all local files that exist on GitHub. (
git fetch --all && git reset --hard origin/master
) - Push your local copy back to your project. (
clasp push
)
If all goes well (and .gitignore and .claspignore are set up correctly), this should result in saving the most recent versions of any custom files on your Google Apps Script (like triggerable.js) while overwriting all of the other source code with the latest version. If all does not go well (e.g. you are customizing code or a new version overwrites your existing file), your work will be lost. Use at your own risk.