verify that deleted filepath is a rules file
This commit is contained in:
parent
970552b44c
commit
904357d06c
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue