mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-25 19:13:56 +03:00
a7729dae87
* Adjusts the location open uses Currently when using open, the cli will ignore the host and protocol and always open `http://localhost`. This pr adjusts the open script to use the options protocol and host and default back to localhost if not provided. * adds changeset * fixes grammar * adjusts electron path to respect protocol and host as well Co-authored-by: Nathan Bierema <nbierema@gmail.com>
30 lines
756 B
JavaScript
30 lines
756 B
JavaScript
// Based on https://github.com/electron/electron-quick-start
|
|
|
|
const { app, BrowserWindow } = require('electron');
|
|
const argv = require('minimist')(process.argv.slice(2));
|
|
|
|
function createWindow() {
|
|
const mainWindow = new BrowserWindow({
|
|
width: 800,
|
|
height: 600,
|
|
});
|
|
|
|
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(() => {
|
|
createWindow();
|
|
|
|
app.on('activate', function () {
|
|
if (BrowserWindow.getAllWindows().length === 0) createWindow();
|
|
});
|
|
});
|
|
|
|
app.on('window-all-closed', function () {
|
|
if (process.platform !== 'darwin') app.quit();
|
|
});
|