fix(redux-devtools-cli): forward port to spawned electron (#564)

This commit is contained in:
Nicholas Hwang 2020-08-08 12:32:16 -04:00 committed by GitHub
parent d312ca2057
commit a1c2f068b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,11 @@ var spawn = require('cross-spawn');
function open(app, options) { function open(app, options) {
if (app === true || app === 'electron') { if (app === true || app === 'electron') {
try { try {
spawn.sync(require('electron'), [path.join(__dirname, '..', 'app')]); var port = options.port ? '--port=' + options.port : '';
spawn.sync(require('electron'), [
path.join(__dirname, '..', 'app'),
port
]);
} catch (error) { } catch (error) {
/* eslint-disable no-console */ /* eslint-disable no-console */
if (error.message === "Cannot find module 'electron'") { if (error.message === "Cannot find module 'electron'") {