-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
22 lines (18 loc) · 685 Bytes
/
app.js
File metadata and controls
22 lines (18 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"use strict";
const path = require("path");
const fs = require("fs");
""
const outputDir = path.resolve(__dirname, "dist");
try {
let heroTypes = JSON.parse(fs.readFileSync("./hero_types.json", "utf8"));
let staticData = JSON.parse(fs.readFileSync("./static_data.json", "utf8"));
for (let i = heroTypes.length - 1; i >= 0; i--) {
let heroId = heroTypes[i].baseId;
heroTypes[i].name = staticData.StaticDataLocalization[`l10n:hero-type/name?id=${heroId}#static`];
}
fs.writeFileSync(path.resolve(outputDir, "hero_types.json"), JSON.stringify(heroTypes, null, "\t"), "utf8");
} catch (e) {
console.log(e);
} finally {
console.log("done");
}