mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 22:19:48 +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,
|
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(() => {
|
app.whenReady().then(() => {
|
||||||
|
|
|
@ -7,10 +7,15 @@ export default async function openApp(app: true | string, options: Options) {
|
||||||
if (app === true || app === 'electron') {
|
if (app === true || app === 'electron') {
|
||||||
try {
|
try {
|
||||||
const port = options.port ? `--port=${options.port}` : '';
|
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
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
spawn.sync(require('electron') as string, [
|
spawn.sync(require('electron') as string, [
|
||||||
path.join(__dirname, '..', '..', 'app'),
|
path.join(__dirname, '..', '..', 'app'),
|
||||||
port,
|
port,
|
||||||
|
host,
|
||||||
|
protocol,
|
||||||
]);
|
]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user