Make preserveEnv return a new object

Modifying the object didn't feel quite right, plus this makes the code a
bit more compact.
This commit is contained in:
Asher
2019-04-29 11:49:59 -05:00
parent 1622fd4152
commit cdb900aca8
5 changed files with 20 additions and 39 deletions

View File

@@ -7,7 +7,7 @@ import { ParsedArgs } from "vs/platform/environment/common/environment";
import { Emitter } from "@coder/events/src";
import { retry } from "@coder/ide/src/retry";
import { logger, field, Level } from "@coder/logger";
import { preserveEnv } from "@coder/protocol";
import { withEnv } from "@coder/protocol";
export enum SharedProcessState {
Stopped,
@@ -89,15 +89,10 @@ export class SharedProcess {
this.activeProcess.kill();
}
let forkOptions = {
env: {
VSCODE_ALLOW_IO: "true"
}
}
preserveEnv(forkOptions);
const activeProcess = forkModule("vs/code/electron-browser/sharedProcess/sharedProcessMain", [], forkOptions, this.userDataDir);
const activeProcess = forkModule(
"vs/code/electron-browser/sharedProcess/sharedProcessMain", [],
withEnv({ env: { VSCODE_ALLOW_IO: "true" } }), this.userDataDir,
);
this.activeProcess = activeProcess;
await new Promise((resolve, reject): void => {