-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
48 lines (45 loc) · 1.63 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const { initLogger } = require('@jx3box/jx3box-build-common/logger');
/** @type {Object<string, Object<string, Function>>} */
const support_field = {
// 技能图标
skill_icon: {
std: require('./build/skill_icon.js')('std'),
origin: require('./build/skill_icon.js')('origin'),
},
// 技能名称反查
skill_name_to_id_level: {
std: require('./build/skill_name_to_id_level.js')('std'),
origin: require('./build/skill_name_to_id_level.js')('origin'),
},
};
let build_fields = process.argv[2]?.split(',');
let build_clients = process.argv[3]
? process.argv[3].split(',')
: ['std', 'origin', 'all'];
const logger = initLogger('jx3-data/main');
(async () => {
if (!build_fields || build_fields.length == 0)
build_fields = Object.keys(support_field);
logger.info(
`开始构建,本次构建包括${build_clients.join(
','
)}客户端的以下表:${build_fields.join(',')}`
);
for (let build_field of build_fields) {
if (!support_field.hasOwnProperty(build_field)) {
logger.warn(`警告:${build_field}表的解包数据构建暂未受到支持`);
continue;
}
let build_scripts = support_field[build_field];
for (let build_client of build_clients) {
if (!build_scripts.hasOwnProperty(build_client)) {
continue;
}
logger.info(`执行:${build_field}:${build_client}`);
let script = build_scripts[build_client];
await script();
}
}
logger.success('构建完成');
await logger.end();
})();