Skip to content

Commit 574bd1c

Browse files
committed
Fix url resolving
1 parent a086560 commit 574bd1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: menu.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { ipcMain, ipcRenderer } = require('electron')
22
const path = require('path')
3+
const url = require('url')
34
const os = require('os')
45

56
const Menu = require('electron').Menu || require('electron').remote.Menu
@@ -26,7 +27,7 @@ const template = [
2627
label: 'New File',
2728
accelerator: 'CmdOrCtrl+N',
2829
click () {
29-
exec('createWindow', {url: `file://${path.join(__dirname, `index.html?target=${path.join(getServerUrl(), '/new')}`)}`})
30+
exec('createWindow', {url: `file://${path.join(__dirname, `index.html?target=${url.resolve(getServerUrl(), '/new')}`)}`})
3031
}
3132
},
3233
{

0 commit comments

Comments
 (0)