feat(showcase): add operator voice
This commit is contained in:
@@ -23,6 +23,7 @@ export default class EnvGenerator {
|
||||
`VITE_IMAGE_HEIGHT=2048`,
|
||||
`VITE_BACKGROUND_FILES=${JSON.stringify(this.#assets.backgrounds)}`,
|
||||
`VITE_BACKGROUND_FOLDER=${__config.folder.background}`,
|
||||
`VITE_VOICE_FOLDERS=${JSON.stringify(__config.folder.voice)}`,
|
||||
].join('\n')
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,15 @@ export async function copy(sourcePath, targetPath) {
|
||||
return await fsP.copyFile(sourcePath, targetPath)
|
||||
}
|
||||
|
||||
export async function copyDir(sourcePath, targetPath) {
|
||||
if (!exists(sourcePath)) {
|
||||
console.warn(`Source file ${sourcePath} does not exist.`)
|
||||
return
|
||||
}
|
||||
mkdir(targetPath)
|
||||
return await fsP.cp(sourcePath, targetPath, { recursive: true })
|
||||
}
|
||||
|
||||
export function appendSync(content, filePath) {
|
||||
return fs.appendFileSync(filePath, content, 'utf8');
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import { mkdir, writeSync } from './file.js'
|
||||
import { appendMainConfig } from './append.js'
|
||||
|
||||
export default function init(operatorName, extractedDir) {
|
||||
mkdir(extractedDir)
|
||||
extractedDir.forEach((dir) => {
|
||||
mkdir(dir)
|
||||
})
|
||||
const date = new Date()
|
||||
const template = readYAML(path.join(__dirname, 'config', '_template.yaml'))
|
||||
template.link = operatorName
|
||||
|
||||
Reference in New Issue
Block a user