Skip to content

Commit

Permalink
Use the default argument of child_process.spawn
Browse files Browse the repository at this point in the history
  const defaults = {
    cwd: undefined,
    env: process.env
  };
  • Loading branch information
MaskRay committed Apr 8, 2019
1 parent c57e29c commit 2a41a8f
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/serverContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,26 +428,8 @@ export class ServerContext implements Disposable {
private initClient(): LanguageClient {
const args = this.cliConfig.launchArgs;

const env: any = {};
const kToForward = [
'ProgramData',
'PATH',
'CPATH',
'LIBRARY_PATH',
];
for (const e of kToForward)
env[e] = process.env[e];

const serverOptions: ServerOptions = async (): Promise<cp.ChildProcess> => {
const opts: cp.SpawnOptions = {
cwd: this.cwd,
env
};
const child = cp.spawn(
this.cliConfig.launchCommand,
args,
opts
);
const child = cp.spawn(this.cliConfig.launchCommand, args);
this.clientPid = child.pid;
return child;
};
Expand Down

0 comments on commit 2a41a8f

Please sign in to comment.