feat(background): add other in-game backgrouds (1/2)

Co-authored-by: yueqiaocertik <yueqiaocertik@users.noreply.github.com>
This commit is contained in:
Haoyu Xu
2023-01-19 00:22:34 -05:00
parent f067e8f194
commit 5669f78009
9 changed files with 190 additions and 114 deletions

18
libs/append.js Normal file
View File

@@ -0,0 +1,18 @@
import path from 'path'
import { appendSync, readSync } from './file.js'
export function appendReadme(config, operatorName, rootDir) {
const operatorConfig = config.operators[operatorName]
const projectJson = JSON.parse(readSync(path.join(rootDir, config.folder.operator, operatorName, 'project.json')))
appendSync(
`\n| ${operatorConfig.title.split(' - ')[0].split('Arknights: ')[1]} | [Link](https://arknights.halyul.dev/${operatorConfig.link}/) | [Link](https://steamcommunity.com/sharedfiles/filedetails/?id=${projectJson.workshopid}) |`,
path.join(rootDir, 'README.md')
)
}
export function appendMainConfig(operatorName, rootDir) {
appendSync(
`\n ${operatorName}: !include config/${operatorName}.yaml`,
path.join(rootDir, 'config.yaml')
)
}