mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
add delete folder function
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user