add cwd to StdioServerParameters
This commit is contained in:
parent
13c3eea3b8
commit
d28ab78b3f
1 changed files with 10 additions and 2 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import { ChildProcess, IOType, spawn } from "node:child_process";
|
||||
import process from "node:process";
|
||||
import { ReadBuffer, serializeMessage } from "../shared/stdio.js";
|
||||
import { JSONRPCMessage } from "../types.js";
|
||||
import { Transport } from "../shared/transport.js";
|
||||
import { Stream } from "node:stream";
|
||||
import { ReadBuffer, serializeMessage } from "../shared/stdio.js";
|
||||
import { Transport } from "../shared/transport.js";
|
||||
import { JSONRPCMessage } from "../types.js";
|
||||
|
||||
export type StdioServerParameters = {
|
||||
/**
|
||||
|
|
@ -29,6 +29,13 @@ export type StdioServerParameters = {
|
|||
* The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr.
|
||||
*/
|
||||
stderr?: IOType | Stream | number;
|
||||
|
||||
/**
|
||||
* The working directory to use when spawning the process.
|
||||
*
|
||||
* If not specified, the current working directory will be inherited.
|
||||
*/
|
||||
cwd?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -114,6 +121,7 @@ export class StdioClientTransport implements Transport {
|
|||
shell: false,
|
||||
signal: this._abortController.signal,
|
||||
windowsHide: process.platform === "win32" && isElectron(),
|
||||
cwd: this._serverParams.cwd,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue