diff --git a/Version b/Version index fd2a018..944880f 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -3.1.0 +3.2.0 diff --git a/config/_template.yaml b/config/_template.yaml index 5f2768d..fe903e6 100644 --- a/config/_template.yaml +++ b/config/_template.yaml @@ -1,6 +1,6 @@ link: chen -type: operator date: 2021/08 +type: operator title: 'Arknights: Ch''en/Chen the Holungday - 明日方舟:假日威龙陈' filename: dyn_illust_char_1013_chen2 logo: logo_rhodes_override diff --git a/libs/initializer.js b/libs/initializer.js index 472d2fc..f72ff61 100644 --- a/libs/initializer.js +++ b/libs/initializer.js @@ -1,9 +1,15 @@ import path from 'path' -import { mkdir, copy } from './file.js' +import { stringify } from 'yaml' +import { read as readYAML } from './yaml.js' +import { mkdir, writeSync } from './file.js' import { appendMainConfig } from './append.js' export default function init(extractedDir) { mkdir(extractedDir) - copy(path.join(__dirname, 'config', '_template.yaml'), path.join(__dirname, 'config', `${__operator_name}.yaml`)) + const date = new Date() + const template = readYAML(path.join(__dirname, 'config', '_template.yaml')) + template.link = __operator_name + template.date = `${date.getFullYear()}/${(date.getMonth() + 1).toString().padStart(2, '0') }` + writeSync(stringify(template), path.join(__dirname, 'config', `${__operator_name}.yaml`)) appendMainConfig(__operator_name, __dirname) } \ No newline at end of file