verify that deleted filepath is a rules file

This commit is contained in:
uinstinct
2026-01-19 19:47:59 +05:30
parent 970552b44c
commit 904357d06c

View File

@@ -435,6 +435,12 @@ export class Core {
on("config/deleteRule", async (msg) => {
try {
const filepath = msg.data.filepath;
if (
!isColocatedRulesFile(filepath) &&
!isContinueConfigRelatedUri(filepath)
) {
throw new Error("Only rule files can be deleted");
}
const fileExists = await this.ide.fileExists(filepath);
if (fileExists) {
await this.ide.removeFile(filepath);