feat(showcase): add music

This commit is contained in:
Haoyu Xu
2023-03-15 21:27:34 -04:00
parent cf933d6a56
commit f3aa867e00
24 changed files with 449 additions and 166 deletions

View File

@@ -23,7 +23,7 @@ export function getOperatorId(operatorConfig) {
export default class CharwordTable {
#operatorIDs = Object.values(__config.operators).map(operator => { return getOperatorId(operator) })
#charwordTablePath = path.join(__projetRoot, __config.folder.operator, __config.folder.share)
#charwordTablePath = path.join(__projectRoot, __config.folder.operator, __config.folder.share)
#charwordTableFile = path.join(this.#charwordTablePath, 'charword_table.json')
#charwordTable = JSON.parse(readSync(this.#charwordTableFile)) || {
config: {
@@ -135,10 +135,10 @@ export default class CharwordTable {
console.log(`charword_table_${region}.json is updated.`)
// remove old file
const files = readdirSync(path.join(__projetRoot, __config.folder.operator, __config.folder.share))
const files = readdirSync(path.join(__projectRoot, __config.folder.operator, __config.folder.share))
for (const file of files) {
if (file.startsWith(`charword_table_${region}`) && file !== path.basename(filepath)) {
rm(path.join(__projetRoot, __config.folder.operator, __config.folder.share, file))
rm(path.join(__projectRoot, __config.folder.operator, __config.folder.share, file))
}
}
return data
@@ -215,10 +215,10 @@ export default class CharwordTable {
console.log(`charword_table_${region}.json is updated.`)
// remove old file
const files = readdirSync(path.join(__projetRoot, __config.folder.operator, __config.folder.share))
const files = readdirSync(path.join(__projectRoot, __config.folder.operator, __config.folder.share))
for (const file of files) {
if (file.startsWith(`charword_table_${region}`) && file !== path.basename(filepath)) {
rm(path.join(__projetRoot, __config.folder.operator, __config.folder.share, file))
rm(path.join(__projectRoot, __config.folder.operator, __config.folder.share, file))
}
}
output.data = data
@@ -233,10 +233,10 @@ export default class CharwordTable {
console.log(`handbook_info_table_${region}.json is updated.`)
// remove old file
const files = readdirSync(path.join(__projetRoot, __config.folder.operator, __config.folder.share))
const files = readdirSync(path.join(__projectRoot, __config.folder.operator, __config.folder.share))
for (const file of files) {
if (file.startsWith(`handbook_info_table_${region}`) && file !== path.basename(handbookFilepath)) {
rm(path.join(__projetRoot, __config.folder.operator, __config.folder.share, file))
rm(path.join(__projectRoot, __config.folder.operator, __config.folder.share, file))
}
}
output.handbook = data