-
-
Notifications
You must be signed in to change notification settings - Fork 746
Expand file tree
/
Copy pathcommandLine.ts
More file actions
28 lines (22 loc) · 827 Bytes
/
commandLine.ts
File metadata and controls
28 lines (22 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type { Socket } from "net";
let electronSocket: Socket;
export = (socket: Socket, app: Electron.App) => {
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);
});
};