mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-14 19:41:09 +00:00
use old prompt
This commit is contained in:
@@ -422,6 +422,14 @@ const Chat = forwardRef<ChatRef, ChatProps>((props, ref) => {
|
||||
if (toolArgs.type === 'write_to_file') {
|
||||
let newFile = false
|
||||
if (!opFile) {
|
||||
// 确保目录结构存在
|
||||
const dir = path.dirname(toolArgs.filepath)
|
||||
if (dir && dir !== '.' && dir !== '/') {
|
||||
const dirExists = await app.vault.adapter.exists(dir)
|
||||
if (!dirExists) {
|
||||
await app.vault.adapter.mkdir(dir)
|
||||
}
|
||||
}
|
||||
opFile = await app.vault.create(toolArgs.filepath, '')
|
||||
newFile = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user