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