Skip to content

Commit 87bac01

Browse files
committed
Don't add custom Event menu to mapping spreadsheet
1 parent e60cdcc commit 87bac01

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tools/appscript/create-onopen-trigger.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
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 &&

tools/appscript/lib/w3cid-map.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getEnvKey } from '../../common/envkeys.mjs';
44
* Fetch private mapping information from the Google sheet
55
*/
66
export 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 = {};

0 commit comments

Comments
 (0)