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 bedca05
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/serverContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,25 +428,10 @@ 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
);
this.clientPid = child.pid;
return child;
Expand Down

0 comments on commit bedca05

Please sign in to comment.