Browse Source

Remove unnecessary check

Mentioned in rmdir docs

Tested on macOS with a node shell

    > await fs.rmdir("/tmp/foo/bar/baz")
    Uncaught [Error: ENOTEMPTY: directory not empty, rmdir '/tmp/foo/bar/baz']
Manav Rathi 1 year ago
parent
commit
0f1c2fa1cd
1 changed files with 0 additions and 4 deletions
  1. 0 4
      desktop/src/main/fs.ts

+ 0 - 4
desktop/src/main/fs.ts

@@ -107,10 +107,6 @@ export const isFolder = async (dirPath: string) => {
 };
 };
 
 
 export const deleteFolder = async (folderPath: string) => {
 export const deleteFolder = async (folderPath: string) => {
-    // Ensure folder is empty
-    const files = await fs.readdir(folderPath);
-    if (files.length > 0) throw new Error("Folder is not empty");
-
     // rm -rf it
     // rm -rf it
     await fs.rmdir(folderPath);
     await fs.rmdir(folderPath);
 };
 };