add delete folder function

This commit is contained in:
MathieuG-P
2022-06-19 21:53:36 +02:00
parent 0e0a2faba8
commit 3cabf36ca9
+5
View File
@@ -3,6 +3,7 @@ import { spawnSync } from "child_process";
import { homedir } from "os";
import path from "path";
import { BrowserWindow } from "electron";
import { rm } from "fs/promises";
export class UtilsService{
@@ -59,6 +60,10 @@ export class UtilsService{
return files.map(f => f.name);
}
public deleteFolder(folderPath: string): Promise<void>{
return rm(folderPath, {recursive: true});
}
public ipcSend(channel: string, args?: any){
this.mainWindow.webContents.send(channel, args);
}