19 lines
671 B
JavaScript
19 lines
671 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
const { API_ITEM_STATIC_HTML } = require('../src/config/Api60sConfig.js');
|
|
|
|
const pub = path.join(__dirname, '../public');
|
|
const bad = [];
|
|
for (const [id, p] of Object.entries(API_ITEM_STATIC_HTML)) {
|
|
const rel = p.replace(/^\//, '');
|
|
const full = path.join(pub, rel);
|
|
if (!fs.existsSync(full)) bad.push({ id, p, full });
|
|
}
|
|
if (bad.length === 0) {
|
|
console.log(`全部 ${Object.keys(API_ITEM_STATIC_HTML).length} 个静态路径对应文件均存在`);
|
|
} else {
|
|
console.log('缺失文件数:', bad.length);
|
|
console.log(JSON.stringify(bad, null, 2));
|
|
}
|
|
process.exit(bad.length ? 1 : 0);
|