mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 12:05:18 +02:00
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:
@@ -2,7 +2,7 @@
|
||||
import { EventEmitter } from "events";
|
||||
import * as pty from "node-pty";
|
||||
import { ServerProxy } from "../../common/proxy";
|
||||
import { preserveEnv } from "../../common/util";
|
||||
import { withEnv } from "../../common/util";
|
||||
|
||||
// tslint:disable completed-docs
|
||||
|
||||
@@ -66,8 +66,6 @@ export class NodePtyProcessProxy extends ServerProxy {
|
||||
*/
|
||||
export class NodePtyModuleProxy {
|
||||
public async spawn(file: string, args: string[] | string, options: pty.IPtyForkOptions): Promise<NodePtyProcessProxy> {
|
||||
preserveEnv(options);
|
||||
|
||||
return new NodePtyProcessProxy(require("node-pty").spawn(file, args, options));
|
||||
return new NodePtyProcessProxy(require("node-pty").spawn(file, args, withEnv(options)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user