mirror of
https://github.com/one-among-us/data.git
synced 2024-11-22 19:24:51 +08:00
[+] copyTDORComments
This commit is contained in:
parent
7e92edcf38
commit
2c85dc37e6
@ -185,10 +185,30 @@ function copyPublic() {
|
||||
fs.copySync(path.join(projectRoot, PUBLIC_DIR), path.join(projectRoot, DIST_DIR));
|
||||
}
|
||||
|
||||
function copyTDORComments() {
|
||||
const commentPath = path.join(peopleDir, 'tdor', COMMENTS_DIR);
|
||||
const distPath = path.join(projectRoot, DIST_DIR, PEOPLE_DIR, 'tdor');
|
||||
fs.ensureDirSync(commentPath);
|
||||
var info = { comments: [] };
|
||||
info.comments = fs
|
||||
.readdirSync(commentPath)
|
||||
.filter((cf) => cf.endsWith(".json"))
|
||||
.map((cf) =>
|
||||
JSON.parse(fs.readFileSync(path.join(commentPath, cf), "utf-8"))
|
||||
);
|
||||
info.comments.forEach((c) => (c.content = autocorrect.format(c.content)));
|
||||
fs.ensureDirSync(distPath);
|
||||
fs.writeFileSync(
|
||||
path.join(distPath, 'info.json'),
|
||||
JSON.stringify(info)
|
||||
);
|
||||
}
|
||||
|
||||
buildPeopleInfoAndList();
|
||||
buildPeoplePages();
|
||||
copyPeopleAssets();
|
||||
copyPublic();
|
||||
copyTDORComments();
|
||||
|
||||
/**
|
||||
* Trim a specific char from a string
|
||||
|
Loading…
Reference in New Issue
Block a user