fix: 尝试支持设定分享和导入 (#286)

* fix: 尝试支持设定分享和导入

* fix: 设定分享和洗脑操作的帮助

* fix: 导入设定失败的提示

* fix: 允许覆盖修改

* fix: version
This commit is contained in:
ikechan8370 2023-03-26 16:15:15 +08:00 committed by GitHub
parent 07d1db0a2a
commit bfc55df6a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 268 additions and 16 deletions

View file

@ -40,3 +40,11 @@ export function saveOnePrompt (name, content) {
let filePath = `${_path}/plugins/chatgpt-plugin/prompts/${name}.txt`
fs.writeFileSync(filePath, content)
}
export function deleteOnePrompt (name) {
const _path = process.cwd()
mkdirs(`${_path}/plugins/chatgpt-plugin/prompts`)
let filePath = `${_path}/plugins/chatgpt-plugin/prompts/${name}.txt`
fs.unlinkSync(filePath)
}