update: 2026-03-28 20:59
This commit is contained in:
18
InfoGenie-frontend/scripts/verify-60sapi-paths.js
Normal file
18
InfoGenie-frontend/scripts/verify-60sapi-paths.js
Normal file
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user