File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1+ import { getEnvKey } from '../common/envkeys.mjs' ;
2+
13/**
24 * Main script function that registers the "addTPACMenu" trigger across
35 * the spreadseets identified in the previous array
46 */
5- export default function ( ) {
7+ export default async function ( ) {
68 // Ideally, the script would just look for the folder it lives in, but there
79 // does not seem to be a way to get a handle on that folder from within the
810 // script, so we need to store the ID in the project's settings.
911 const scriptProperties = PropertiesService . getScriptProperties ( ) ;
1012 const SHARED_FOLDER = scriptProperties . getProperty ( 'SHARED_FOLDER' ) ;
13+ const W3CID_SPREADSHEET = await getEnvKey ( 'W3CID_SPREADSHEET' ) ;
1114
1215 const folder = DriveApp . getFolderById ( SHARED_FOLDER ) ;
1316 const files = folder . getFilesByType ( MimeType . GOOGLE_SHEETS ) ;
1417 while ( files . hasNext ( ) ) {
1518 const file = files . next ( ) ;
1619 const id = file . getId ( ) ;
1720 const triggers = ScriptApp . getProjectTriggers ( ) ;
18- let shouldCreateTrigger = true ;
21+ let shouldCreateTrigger = ( id !== W3CID_SPREADSHEET ) ;
1922 triggers . forEach ( function ( trigger ) {
2023 if ( trigger . getTriggerSourceId ( ) === id &&
2124 trigger . getEventType ( ) === ScriptApp . EventType . ON_OPEN &&
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { getEnvKey } from '../../common/envkeys.mjs';
44 * Fetch private mapping information from the Google sheet
55 */
66export async function fetchMapping ( ) {
7- const W3CID_SPREADSHEET = await getEnvKey ( 'W3CID_SPREADSHEET' ) ;
7+ const W3CID_SPREADSHEET = await getEnvKey ( 'W3CID_SPREADSHEET' ) ;
88 const spreadsheet = SpreadsheetApp . openById ( W3CID_SPREADSHEET ) ;
99
1010 const mapping = { } ;
You can’t perform that action at this time.
0 commit comments