Explorar el Código

Use path.join for pathname

Kevin Sawicki hace 9 años
padre
commit
0af284c37c
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      main.js

+ 2 - 1
main.js

@@ -4,6 +4,7 @@ const app = electron.app
 // Module to create native browser window.
 const BrowserWindow = electron.BrowserWindow
 
+const path = require('path')
 const url = require('url')
 
 // Keep a global reference of the window object, if you don't, the window will
@@ -16,7 +17,7 @@ function createWindow () {
 
   // and load the index.html of the app.
   mainWindow.loadURL(url.format({
-    pathname: __dirname + '/index.html',
+    pathname: path.join(__dirname, 'index.html'),
     protocol: 'file:',
     slashes: true
   }))