mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 14:09:46 +03:00
adjusts electron path to respect protocol and host as well
This commit is contained in:
parent
6b4e1020a8
commit
1862e3240a
|
@ -9,7 +9,11 @@ function createWindow() {
|
|||
height: 600,
|
||||
});
|
||||
|
||||
mainWindow.loadURL('http://localhost:' + (argv.port ? argv.port : 8000));
|
||||
const port = argv.port ? argv.port : 8000;
|
||||
const host = argv.host ? argv.host : 'localhost';
|
||||
const protocol = argv.protocol ? argv.protocol : 'http';
|
||||
|
||||
mainWindow.loadURL(protocol + '://' + host + ':' + port);
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
|
|
|
@ -7,10 +7,15 @@ export default async function openApp(app: true | string, options: Options) {
|
|||
if (app === true || app === 'electron') {
|
||||
try {
|
||||
const port = options.port ? `--port=${options.port}` : '';
|
||||
const host = options.host ? `--host=${options.host}` : '';
|
||||
const protocol = options.protocol ? `--protocol=${options.protocol}` : '';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
spawn.sync(require('electron') as string, [
|
||||
path.join(__dirname, '..', '..', 'app'),
|
||||
port,
|
||||
host,
|
||||
protocol,
|
||||
]);
|
||||
} catch (error) {
|
||||
/* eslint-disable no-console */
|
||||
|
|
Loading…
Reference in New Issue
Block a user