copyConfigSync
约 131 字小于 1 分钟
2025-10-13
Karin API Docs / copyConfigSync
函数: copyConfigSync()
copyConfigSync(
defaulPath,userPath,suffixs,isThrow):boolean
定义于: packages/core/src/utils/fs/file.ts:177
创建配置文件 同步
参数
defaulPath
string
模板配置文件路径
userPath
string
目标文件夹路径
suffixs
string[] = []
需要复制的文件后缀 可带点
isThrow
boolean = false
是否抛出异常 默认不抛出
返回
boolean
是否复制成功
Description
从模板配置文件复制到目标文件夹
示例
copyConfigSync('defaultPath', 'userPath')
copyConfigSync('defaultPath', 'userPath', ['yaml'])
copyConfigSync('defaultPath', 'userPath', ['.yaml', 'json'])
copyConfigSync('defaultPath', 'userPath', [], true)