Browse Source

Remove unnecessary check

rmdir docs already mention it'll only work on folders

Also tested on macOS with a node shell

    > await fs.rmdir("/tmp/foo/bar/baz/quxx.txt")
    Uncaught [Error: ENOTDIR: not a directory, rmdir '/tmp/foo/bar/baz/quxx.txt'] {
Manav Rathi 1 year ago
parent
commit
fb5ae3a2ac
1 changed files with 0 additions and 3 deletions
  1. 0 3
      desktop/src/main/fs.ts

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

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