Procházet zdrojové kódy

Chargement uniquement fichier

Arthur Brandao před 5 roky
rodič
revize
1d2de872b7
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      main.js

+ 4 - 1
main.js

@@ -81,7 +81,10 @@ function createMainWindow(simple = false) {
 function loadMainProcessFiles() {
   const mainProcessFiles = file.list(path.join(__dirname, folder, 'main/'));
   mainProcessFiles.forEach(f => {
-    require(path.join(__dirname, folder, 'main/', f));
+    const filepath = path.join(__dirname, folder, 'main/', f)
+    if (file.isFile(filepath)) {
+      require(filepath);
+    }
   });
 }