From 52c01b6bd5a63d514ca083edf2f10d25c03d6cb0 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 27 May 2018 11:26:34 +0200 Subject: Add SPLUS_CONFIG env var --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 3d7e588..7348f6d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,4 +54,4 @@ async function main(configPath) { await sink.commit(); } -main(process.argv[2] || './config-example.json').catch(console.log); +main(process.env.SPLUS_CONFIG || process.argv[2] || './config-example.json').catch(console.log); -- cgit v1.3.1 From 10e3d8fdc85d97cb131d0dc0745c281d6dab4895 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 27 May 2018 11:46:32 +0200 Subject: Update readme --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d38f5a1..74658ff 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,13 @@ The [Ostfalia SPlus lecture schedule](http://splus.ostfalia.de) is complicated t ## Setup -### General +Run `npm install` to install the necessary dependencies. Copy `config-example.json`. -Run `npm install` to install the necessary dependencies. +Start with `npm start ./config.json` or export `SPLUS_CONFIG=./config.json`. `./config-example.json` is the default configuration path. -### Google +#### Google OAuth setup -Follow the steps provided by Google: https://developers.google.com/calendar/auth#OAuth2Authorizing +Follow the [steps provided by Google](https://developers.google.com/calendar/auth#OAuth2Authorizing). You will receive a `client_secret.json` file which contains your Google API credentials. Save this file as `etc/google/client_secret.json`. -Adjust `config.ts` so that it uses the `sinks/GoogleCalendarSink`. Then run `npm start` in a terminal, visit the printed link and paste the code that will be provided there into the terminal window. - -### ICS - -Adjust `config.ts` so that it uses the `sinks/IcalSink`. Run `npm start` to generate the calendar file. +Omit `"icsPath"` in the configuration file. -- cgit v1.3.1 From b1ca29140b641adc83e16bca5e21d8e31fd56ecd Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 27 May 2018 11:59:00 +0200 Subject: Remove todo - ICS can't conflict if it's rewritten 💩 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sinks/IcalSink.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sinks/IcalSink.ts b/src/sinks/IcalSink.ts index efb94ac..dd94ac5 100644 --- a/src/sinks/IcalSink.ts +++ b/src/sinks/IcalSink.ts @@ -20,7 +20,6 @@ export class IcalSink implements ISink { } createEvent(event: IEvent): Promise { - // TODO better duplicate detection and resolve conflicts lol const eventId = sha256(JSON.stringify(event)).substr(0, 16); const icalEvent = this._cal.createEvent({ -- cgit v1.3.1