-
-
Notifications
You must be signed in to change notification settings - Fork 0
Guide to Developing Locally
FOLLOW ALL 'Guide to Running Locally' STEPS FIRST!
npm run clasp:login
-
This will redirect to a Google Sign in screen. Sign in with [email protected]
-
Click 'Allow' to allow all permissions
-
To confirm that you're logged in:
npm run clasp:status
Now, you are ready to start developing!
When you edit Apps Scripts (located in the src/Helpers/AppsScript
folder), the changes are NOT reflected on the deployed Apps Scripts until you push. When you push, the Node CI GitHub Action automatically pushes your Apps Script changes.
If you wish to to push your local Apps Script changes to production without committing and pushing, run npm run clasp
. Make sure you have copied the .clasp.json
file from the 'Secret Files' folder in Google Drive.
.
If you need to use constants defined in src/Utils/constants.ts
in your Apps Scripts, import the constants as usual but add (code below) somewhere near the start of each file that uses constants. This notifies the pre-clasp
script to fill in the constants when pushing and the post-clasp
script to remove them after the push is completed. We have to do this because clasp removes all imports when deploying the Apps Scripts.
// START CONSTANTS
// END CONSTANTS
If you need to use secret variables in the Apps Scripts, use the format process.env.<VARIABLE_NAME>
. Make sure that the variable is defined in the .env
file. If it is not, follow the 'Creating Environment Variables' wiki for steps on how to create a new environment variable.
See the 'Creating Environment Variables' wiki for information on the multi-step process of creating environment variables.
Created by Yash Totale & Subha Das
© 2021 Hack4Impact