Skip to content

Commit

Permalink
bugfix/806 fix linux UUID folders not deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamillionSS committed Feb 14, 2025
1 parent b0a5e80 commit b38b1e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/helpers/fs.helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CopyOptions, MoveOptions, RmOptions, copy, createReadStream, ensureDir, move, pathExists, pathExistsSync, realpath, rm, stat, symlink, unlink, unlinkSync } from "fs-extra";
import { CopyOptions, MoveOptions, RmOptions, copy, createReadStream, ensureDir, move, pathExists, pathExistsSync, realpath, rm, stat, symlink, unlink, unlinkSync, rmSync } from "fs-extra";
import { access, mkdir, readdir, lstat, readlink } from "fs/promises";
import path from "path";
import { Observable, concatMap, from } from "rxjs";
Expand Down Expand Up @@ -63,14 +63,15 @@ export async function deleteFolder(folderPath: string, options?: RmOptions) {
}
}

export function deleteFolderSync(folderPath: string, options?: RmOptions) {
export async function deleteFolderSync(folderPath: string, options?: RmOptions) {
if (!pathExistsSync(folderPath)) {
return;
}

try {
options = options || { recursive: true, force: true };
log.info("Deleting folder", `"${folderPath}"`, options);
rmSync(folderPath, options);
} catch (error: any) {
log.error("Could not delete folder", `"${folderPath}"`);
throw CustomError.fromError(error, "generic.fs.delete-folder");
Expand Down

0 comments on commit b38b1e8

Please sign in to comment.