Skip to content

Commit

Permalink
fix notion
Browse files Browse the repository at this point in the history
  • Loading branch information
guidone committed Feb 11, 2023
1 parent 7935cbc commit 3ce2006
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/import-from-notion.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ const grey = clc.blackBright;

const nodeDefinitions = require('./nodes');

if (!fs.existsSync(`${__dirname}/../.env-notion`)) {
// notion api key
let notionAuthToken = process.env.NOTION_API_KEY;
if (fs.existsSync(`${__dirname}/../.env-notion`)) {
notionAuthToken = fs.readFileSync(`${__dirname}/../.env-notion`);
}
if (notionAuthToken == null || notionAuthToken === '') {
console.log('Missing notion token, skipping');
process.exit();
}

const notionAuthToken = process.env.NOTION_API_KEY || fs.readFileSync(`${__dirname}/../.env-notion`);

// Initializing a client
const notion = new Client({ auth: notionAuthToken });
Expand Down

0 comments on commit 3ce2006

Please sign in to comment.