Use path.join for pathname

This commit is contained in:
Kevin Sawicki 2016-10-31 10:36:11 -07:00
parent 995d109c32
commit 0af284c37c
1 changed files with 2 additions and 1 deletions

View File

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