mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-29 21:13:54 +03:00
fa1aa952a6
* ramda
* open
* react-icons
* semver
* uuid
* terser-webpack-plugin
* socketcluster-client
* yarn.lock
* More
* Revert "More"
This reverts commit 84f092b7e0
.
* Fix
* snapshot
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
var open = require('open');
|
|
var path = require('path');
|
|
var spawn = require('cross-spawn');
|
|
|
|
function openApp(app, options) {
|
|
if (app === true || app === 'electron') {
|
|
try {
|
|
var port = options.port ? '--port=' + options.port : '';
|
|
spawn.sync(require('electron'), [
|
|
path.join(__dirname, '..', 'app'),
|
|
port,
|
|
]);
|
|
} catch (error) {
|
|
/* eslint-disable no-console */
|
|
if (error.message === "Cannot find module 'electron'") {
|
|
// TODO: Move electron to dev-dependences to make our package installation faster when not needed.
|
|
console.log(
|
|
' \x1b[1;31m[Warn]\x1b[0m Electron module not installed.\n'
|
|
);
|
|
/*
|
|
We will use "npm" to install Electron via "npm install -D".
|
|
Do you want to install 'electron' (yes/no): yes
|
|
Installing 'electron' (running 'npm install -D webpack-cli')...
|
|
*/
|
|
} else {
|
|
console.log(error);
|
|
}
|
|
/* eslint-enable no-console */
|
|
}
|
|
return;
|
|
}
|
|
open(
|
|
'http://localhost:' + options.port + '/',
|
|
app !== 'browser' ? { app: app } : undefined
|
|
);
|
|
}
|
|
|
|
module.exports = openApp;
|