Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
SITE_NAMEを指定するとGASのgetProperty('site_name')の値を指定出来る。そのサイトからスケジュール登録が始…
Browse files Browse the repository at this point in the history
…まるようになる
  • Loading branch information
proshunsuke committed Oct 17, 2021
1 parent eac431a commit 781d286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SITE_NAME=keyakizaka

setup:
$(MAKE) yarn/install

Expand Down Expand Up @@ -26,7 +28,7 @@ run:
yarn clasp run execute

run/local:
node -e 'require("./dist/index.js");global.setSchedule();'
SITE_NAME=$(SITE_NAME) node -e 'require("./dist/index.js");global.setSchedule();'

open:
yarn clasp open
Expand Down
1 change: 1 addition & 0 deletions src/lib/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default class Trigger {
* @returns {string | null}
*/
static getTargetSiteNameProperty(): string | null {
if (process.env.SITE_NAME) return process.env.SITE_NAME;
if (process.env.ENV !== 'production') return null;
const properties = PropertiesService.getScriptProperties();
return properties.getProperty(TARGET_SITE_NAME_KEY);
Expand Down

0 comments on commit 781d286

Please sign in to comment.