Skip to content

Commit

Permalink
feat: support unmatched daily task via environment var
Browse files Browse the repository at this point in the history
  • Loading branch information
casmith committed Oct 10, 2023
1 parent 0584a81 commit 870aca6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ const Habitica = require("./habitica");
const Todoist = require("./todoist");
const Sync = require("./sync");

config.todoist.unmatchedDailyTask =
config.todoist.unmatchedDailyTask || process.env.TODOIST_UNMATCHED_DAILY_TASK;

const todoist = Todoist.from(config.todoist.token, logger);
const habitica = Habitica.from(
config.habitica.apiUser,
config.habitica.apiKey,
logger
logger,
);

const initialSyncToken = process.env.INITIAL_SYNC_TOKEN;
Expand All @@ -70,7 +73,7 @@ new Sync(todoist, habitica, logger, config)
const sync = config.sync;
lastRun.syncToken = sync.sync_token;
logger.info(
`Sync finished, writing lastRun.json with new syncToken: ${lastRun.syncToken}`
`Sync finished, writing lastRun.json with new syncToken: ${lastRun.syncToken}`,
);
jsonFile.writeFileSync(configDir + "lastRun.json", lastRun);
})
Expand Down

0 comments on commit 870aca6

Please sign in to comment.