Skip to content

Commit bab2bdb

Browse files
authored
fix(website): correct json loading (#3565)
This was an error introduced by #3532 clashing with the commit for the new website
1 parent 0f12819 commit bab2bdb

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

site/build.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,14 @@ function main() {
270270
// Read raw data
271271
let rawData = [];
272272
if (fs.existsSync('data/conjectures.json')) {
273-
try {
274-
rawData = JSON.parse(fs.readFileSync('data/conjectures.json', 'utf8'));
275-
} catch (e) {
276-
console.warn('Warning: could not parse data/conjectures.json:', e.message);
277-
}
273+
const parsed = JSON.parse(fs.readFileSync('data/conjectures.json', 'utf8'));
274+
// extract_names outputs { problems: [...], moduleDocstrings: {...} }
275+
rawData = parsed.problems || [];
276+
}
277+
278+
if (rawData.length === 0) {
279+
console.error('Error: no conjectures loaded. Run `lake exe extract_names > site/data/conjectures.json` first.');
280+
process.exit(1);
278281
}
279282

280283
const conjectures = rawData.map(processEntry);

0 commit comments

Comments
 (0)