MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getPortFromFile

Method getPortFromFile

packages/core/src/ide/ide-client.ts:302–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

300 }
301
302 private async getPortFromFile(): Promise<string | undefined> {
303 try {
304 const ideProcessId = await getIdeProcessId();
305 const portFile = path.join(
306 os.tmpdir(),
307 `anus-ide-server-${ideProcessId}.json`,
308 );
309 const portFileContents = await fs.promises.readFile(portFile, 'utf8');
310 const port = JSON.parse(portFileContents).port;
311 return port.toString();
312 } catch (_) {
313 return undefined;
314 }
315 }
316
317 private registerClientHandlers() {
318 if (!this.client) {

Callers 1

connectMethod · 0.95

Calls 2

getIdeProcessIdFunction · 0.85
readFileMethod · 0.80

Tested by

no test coverage detected