diff --git a/package.json b/package.json index d480d71..7215353 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Claude Dev", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.", - "version": "1.5.10", + "version": "1.5.11", "icon": "icon.png", "engines": { "vscode": "^1.84.0" diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index 052001a..79083e9 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -858,7 +858,12 @@ export class ClaudeDev { if (response !== "yesButtonTapped") { await this.closeDiffViews() // Clean up the temporary file - await fs.rm(tempDir, { recursive: true, force: true }) + try { + await fs.rm(tempDir, { recursive: true, force: true }) + } catch (error) { + // deleting temp file failed (seems to happen on some windows machines), which is okay since system will clean it up anyways + console.error(`Error deleting temporary directory: ${error}`) + } if (response === "messageResponse") { await this.say("user_feedback", text, images) return this.formatIntoToolResponse(await this.formatGenericToolFeedback(text), images) @@ -874,7 +879,11 @@ export class ClaudeDev { await fs.writeFile(absolutePath, editedContent) // Clean up the temporary file - await fs.rm(tempDir, { recursive: true, force: true }) + try { + await fs.rm(tempDir, { recursive: true, force: true }) + } catch (error) { + console.error(`Error deleting temporary directory: ${error}`) + } // Finish by opening the edited file in the editor await vscode.window.showTextDocument(vscode.Uri.file(absolutePath), { preview: false })