hdoc-tools 0.17.30 → 0.17.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hdoc-serve.js +10 -1
- package/package.json +1 -1
package/hdoc-serve.js
CHANGED
@@ -86,7 +86,7 @@
|
|
86
86
|
try {
|
87
87
|
hdocbook_config = require(hdocbook_path);
|
88
88
|
} catch (e) {
|
89
|
-
console.log(`\nFailed to load hdocbook.json
|
89
|
+
console.log(`\nFailed to load hdocbook.json:${e}\n`);
|
90
90
|
process.exit(1);
|
91
91
|
}
|
92
92
|
|
@@ -300,6 +300,15 @@
|
|
300
300
|
return;
|
301
301
|
}
|
302
302
|
} else if (fs.existsSync(file_path)) {
|
303
|
+
if (file_path.endsWith('hdocbook.json') || file_path.endsWith('hdocbook_project.json')) {
|
304
|
+
try {
|
305
|
+
// Read & parse file
|
306
|
+
JSON.parse(fs.readFileSync(file_path));
|
307
|
+
} catch (e) {
|
308
|
+
console.log(`Error parsing hdocbook.json: ${e}`);
|
309
|
+
|
310
|
+
}
|
311
|
+
}
|
303
312
|
send_file(req, res, file_path);
|
304
313
|
return;
|
305
314
|
}
|