(actualPort: number)
| 305 | // --------------------------------------------------------------------------- |
| 306 | |
| 307 | const announceReady = (actualPort: number) => { |
| 308 | if (webEnabled) { |
| 309 | const url = `http://${host}:${actualPort}`; |
| 310 | console.log(`\n Skills Pack Server`); |
| 311 | console.log(` Running at ${url}\n`); |
| 312 | |
| 313 | try { |
| 314 | registryRegister({ |
| 315 | dir: canonicalRootDir, |
| 316 | name: packConfig.name, |
| 317 | version: packConfig.version, |
| 318 | port: actualPort, |
| 319 | }); |
| 320 | } catch (err) { |
| 321 | console.warn(" [Registry] Could not register pack:", err); |
| 322 | } |
| 323 | |
| 324 | const cmd = |
| 325 | process.platform === "darwin" |
| 326 | ? `open ${url}` |
| 327 | : process.platform === "win32" |
| 328 | ? `start ${url}` |
| 329 | : `xdg-open ${url}`; |
| 330 | exec(cmd, (err) => { |
| 331 | if (err) console.warn(` Could not open browser: ${err.message}`); |
| 332 | }); |
| 333 | } else { |
| 334 | console.log("\n Skills Pack Server"); |
| 335 | console.log(" Running in embedded mode (IPC only)\n"); |
| 336 | } |
| 337 | |
| 338 | if (hasIpcChannel) { |
| 339 | ipcAdapter.notifyReady(actualPort); |
| 340 | } |
| 341 | }; |
| 342 | |
| 343 | process.on("SIGINT", () => { |
| 344 | registryDeregister(canonicalRootDir, process.pid); |
no test coverage detected