Skip to content

Commit 9de138b

Browse files
committed
fix node scripts
1 parent e2626ef commit 9de138b

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

scripts/github.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import fs from 'fs';
2+
import path from 'path';
3+
import { fileURLToPath } from 'url';
24
import { Octokit } from 'octokit';
35
import 'dotenv/config';
4-
import PROJECT_REPOS from '../config/projects.json' with { type: "json" };
6+
7+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
8+
const PROJECT_REPOS = JSON.parse(fs.readFileSync(path.join(__dirname, '../config/projects.json'), 'utf-8'));
59

610
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
711

scripts/notion.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { NotionToMarkdown } from 'notion-to-md';
22
import { Client } from '@notionhq/client';
33
import fs from 'fs';
4+
import path from 'path';
5+
import { fileURLToPath } from 'url';
46
import crypto from 'crypto';
57
import 'dotenv/config';
6-
import SETTINGS from '../config/site.json' with { type: "json" };
8+
9+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
10+
const SETTINGS = JSON.parse(fs.readFileSync(path.join(__dirname, '../config/site.json'), 'utf-8'));
711

812
const notion = new Client({ auth: process.env.NOTION_TOKEN || '' });
913

0 commit comments

Comments
 (0)