Skip to content

Commit 5ec9972

Browse files
authored
add a delete button to recorded testcase notifications (#1681)
## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet
1 parent 530eb49 commit 5ec9972

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/cursorless-engine/src/testCaseRecorder/TestCaseRecorder.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,20 @@ export class TestCaseRecorder {
368368
"testCaseSaved",
369369
"Cursorless test case saved.",
370370
"View",
371+
"Delete",
371372
).then(async (action) => {
372373
if (action === "View") {
373374
await ide().openTextDocument(outPath);
374375
}
376+
if (action === "Delete") {
377+
await fs.unlink(outPath, (err) => {
378+
if (err) {
379+
console.log("failed to delete ${outPath}: ${err}");
380+
} else {
381+
console.log("deleted ${outPath}");
382+
}
383+
});
384+
}
375385
});
376386
}
377387

0 commit comments

Comments
 (0)