Files
cherry-studio/create_empty_agents.js
T
1600822305 53643e81f0 升级
2025-04-20 01:46:29 +08:00

15 lines
471 B
JavaScript

const fs = require('fs')
const path = require('path')
// 创建一个空的agents.json文件
const emptyAgents = []
const filePath = path.join('resources', 'data', 'agents.json')
// 备份原始文件
fs.copyFileSync(filePath, filePath + '.bak')
console.log('已备份原始文件到 ' + filePath + '.bak')
// 写入新文件
fs.writeFileSync(filePath, JSON.stringify(emptyAgents, null, 2), 'utf8')
console.log('已创建新的agents.json文件,内容为空数组')