MCPcopy Create free account
hub / github.com/Fibi66/FeiControl / readCliPort

Function readCliPort

next.config.mjs:10–24  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

8const distDir = process.env.NEXT_DIST_DIR?.trim() || DEFAULT_DIST_DIR;
9
10function readCliPort(argv) {
11 for (let index = 0; index < argv.length; index += 1) {
12 const arg = argv[index];
13 if (arg === "--port" || arg === "-p") {
14 return argv[index + 1];
15 }
16 if (arg.startsWith("--port=")) {
17 return arg.slice("--port=".length);
18 }
19 if (arg.startsWith("-p=")) {
20 return arg.slice("-p=".length);
21 }
22 }
23 return process.env.PORT?.trim();
24}
25
26function assertPublicRuntimeGuard() {
27 const [, , command, ...args] = process.argv;

Callers 1

assertPublicRuntimeGuardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected