2021-12-13 17:33:00 +01:00
|
|
|
import {Socket} from 'net';
|
|
|
|
|
|
2019-11-30 01:30:22 +01:00
|
|
|
let electronSocket;
|
|
|
|
|
|
2021-07-02 02:04:23 +02:00
|
|
|
export = (socket: Socket, app: Electron.App) => {
|
2019-11-30 01:30:22 +01:00
|
|
|
electronSocket = socket;
|
|
|
|
|
|
|
|
|
|
socket.on('appCommandLineAppendSwitch', (the_switch: string, value: string) => {
|
|
|
|
|
app.commandLine.appendSwitch(the_switch, value);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
socket.on('appCommandLineAppendArgument', (value: string) => {
|
|
|
|
|
app.commandLine.appendArgument(value);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
socket.on('appCommandLineHasSwitch', (value: string) => {
|
|
|
|
|
const hasSwitch = app.commandLine.hasSwitch(value);
|
|
|
|
|
electronSocket.emit('appCommandLineHasSwitchCompleted', hasSwitch);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
socket.on('appCommandLineGetSwitchValue', (the_switch: string) => {
|
|
|
|
|
const value = app.commandLine.getSwitchValue(the_switch);
|
|
|
|
|
electronSocket.emit('appCommandLineGetSwitchValueCompleted', value);
|
|
|
|
|
});
|
|
|
|
|
};
|