Google Apps Script for a spreadsheet to manage timing and generate classifications of triathlon races
RaceRank: Timing & Results is a Google Apps Script for a spreadsheet to manage timing and generate classifications of the competitions promoted by the Portuguese Triathlon Federation.
For the development of RaceRank: Timing & Results, Google Clasp is used and therefore node (and npm) needs to be installed in the development machine.
RaceRank: Timing & Results uses the following npm packages for its development:
To start developing RaceRank: Timing & Results, clone this repository and install the required npm packages with the following commands:
git clone [email protected]:federacao-triatlo/race-rank-timing-results.git
cd race-rank-timing-results
npm install
To setup the connection with the Google Apps Script, copy the file .clasp.json.template
and rename the copy as .clasp.json
. Then define the appropriate values for the scriptId
and rootDir
keys.
To find the scriptId
value of the project, follow the below steps:
- Open Apps Script project.
- At the left, click Project Settings settings.
- Under IDs, copy the Script ID.
The value for the rootDir
key is the absolute path of the local repository.
Then, enable the Google Apps Script on the user settings page.
To enable the connection with the Google Apps Script, it's necessary to sign into the Google account where the Apps Script project are stored. It will be done with the following command:
npm run login
The above command executes one of the scripts defined in the package.json
file. With its execution, a browser window or tab will open, displaying a Google OAuth consent screen. If prompted, select the Google account that you want to use to authenticate Google Clasp.
The consent screen will display the permissions that Google Clasp requires to access your Google account and manage your Google Apps Script projects. Review the permissions carefully to ensure that you trust the application requesting access and then click "Allow" to grant Google Clasp the necessary permissions.
After granting permissions, the Google Clasp authentication token is stored in a file named .clasprc.json
, which is created in the user's home directory (this is a global authentication token).
To pull the code from the online project, execute the following command:
npm run pull
To push your local code changes to the online project, execute the following command:
npm run push
The command clasp push
replaces code that is on online project and clasp pull
replaces all files locally. For this reason, do not concurrently edit code locally and on script.google.com
Check the clasp
official documentation and the clasp
codelabs to learn more about the usage of Google Clasp.
RaceRank: Timing & Results is licensed under the terms of MIT License.