mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-22 06:00:07 +03:00
Changes
This commit is contained in:
parent
d15e6ee0e4
commit
437d6c8b9a
|
@ -3,7 +3,7 @@ import path from 'path';
|
||||||
import spawn from 'cross-spawn';
|
import spawn from 'cross-spawn';
|
||||||
import { Options } from '../options';
|
import { Options } from '../options';
|
||||||
|
|
||||||
export default function openApp(app: boolean | string, options: Options) {
|
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}` : '';
|
||||||
|
@ -31,9 +31,9 @@ export default function openApp(app: boolean | string, options: Options) {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
||||||
open(
|
await open(
|
||||||
`http://localhost:${options.port}/`,
|
`http://localhost:${options.port}/`,
|
||||||
app !== 'browser' ? { app: app as string } : undefined
|
app !== 'browser' ? { app: { name: app } } : undefined
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,8 +90,8 @@ if (argv.injectserver) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
server(argv).then(function (r) {
|
server(argv).then(function (r) {
|
||||||
if (argv.open && argv.open !== 'false') {
|
if (argv.open && argv.open !== 'false') {
|
||||||
r.on('ready', function () {
|
r.on('ready', async function () {
|
||||||
openApp(argv.open, options);
|
await openApp(argv.open, options);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,7 +14,7 @@ export interface ExtendedOptions extends Options {
|
||||||
|
|
||||||
export default function (argv: { [arg: string]: any }): Promise<{
|
export default function (argv: { [arg: string]: any }): Promise<{
|
||||||
portAlreadyUsed?: boolean;
|
portAlreadyUsed?: boolean;
|
||||||
on: (status: 'ready', cb: () => void) => void;
|
on: (status: 'ready', cb: (() => void) | (() => Promise<void>)) => void;
|
||||||
}> {
|
}> {
|
||||||
const options = Object.assign(getOptions(argv), {
|
const options = Object.assign(getOptions(argv), {
|
||||||
workerController: __dirname + '/worker.js',
|
workerController: __dirname + '/worker.js',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user