Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit acc0e67

Browse files
authored
fix[CI]: Updated scripts/proposals-generate.js (#71)
A follow-up PR for #69 to fix deployment
1 parent 2bed0bb commit acc0e67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: scripts/proposals-generate.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
const matter = require('gray-matter');
22
const fs = require('fs');
33
const path = require('path');
4+
const process = require('process');
45

56
// Update metadata
67
let meta = {
78
"index": "Evolution Process"
89
};
9-
const files = fs.readdirSync(__dirname + '/pages/evolution');
10+
const cwd = process.cwd(); // current working directory of the process
11+
const files = fs.readdirSync(cwd + '/pages/evolution');
1012
for (let f of files) {
1113
if (f.endsWith('.mdx') && f.startsWith("OTP-")) {
1214
let name = f.substring(0, f.length - 4);
13-
let title = matter(fs.readFileSync(path.join(__dirname, '/pages/evolution', f), 'utf8')).data.title;
15+
let title = matter(fs.readFileSync(path.join(cwd, '/pages/evolution', f), 'utf8')).data.title;
1416
meta[name] = title;
1517
}
1618
}
1719

1820
// Write metadata
19-
fs.writeFileSync(path.join(__dirname, '/pages/evolution/_meta.json'), JSON.stringify(meta, null, 4));
21+
fs.writeFileSync(path.join(cwd, '/pages/evolution/_meta.json'), JSON.stringify(meta, null, 4));

0 commit comments

Comments
 (0)