Skip to content

Commit f48620d

Browse files
committed
Clean up existing temporary directory before recreating it
- In `invoke-agentic-cli.ts`, add `await fs.promises.rm(temp_dir_path, { recursive: true, force: true }).catch(() => {})` right before the `mkdir` call for the static `cwc-cli` folder so it gets wiped clean before every run. └── apps └── editor └── src ├── utils │ └── agentic-cli-invocation │ ├── index.ts │ └── invoke-agentic-cli.ts └── views └── prompt └── backend ├── message-handlers │ ├── handle-invoke-agentic-cli.ts │ └── utils │ └── build-cli-prompt.ts └── prompt-view-provider.ts
1 parent 87a5a94 commit f48620d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎apps/editor/src/utils/agentic-cli-invocation/invoke-agentic-cli.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ export const invoke_agentic_cli = async (params: {
365365
)
366366
} else {
367367
temp_dir_path = path.join(os.tmpdir(), 'cwc-cli')
368+
await fs.promises
369+
.rm(temp_dir_path, { recursive: true, force: true })
370+
.catch(() => {})
368371
await fs.promises.mkdir(temp_dir_path, { recursive: true })
369372
}
370373

0 commit comments

Comments
 (0)