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

15 lines
471 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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文件内容为空数组')