Skip to content

Commit 4fd164f

Browse files
committed
wip: fix stuff
1 parent 19c9c23 commit 4fd164f

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/node/cli.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ export const parse = (
396396
}
397397

398398
// Everything else goes into _.
399-
args._.push(arg)
399+
// args._.push(arg)
400400
}
401401

402402
// If a cert was provided a key must also be provided.
@@ -492,7 +492,7 @@ export async function setDefaults(cliArgs: Args, configArgs?: ConfigArgs): Promi
492492
// disable auth.
493493
if (args.link) {
494494
args.host = "localhost"
495-
args.port = "0"
495+
// args.port = "0"
496496
args.socket = undefined
497497
args.cert = undefined
498498
args.auth = AuthType.None
@@ -652,9 +652,9 @@ export function bindAddrFromArgs(addr: Addr, args: Args): Addr {
652652
if (process.env.PORT) {
653653
addr.port = parseInt(process.env.PORT, 10)
654654
}
655-
if (args.port !== undefined) {
656-
addr.port = parseInt(args.port, 10)
657-
}
655+
// if (args.port !== undefined) {
656+
// addr.port = parseInt(args.port, 10)
657+
// }
658658
return addr
659659
}
660660

test/unit/node/cli.test.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,9 @@ describe("cli", () => {
410410
process.env.VSCODE_IPC_HOOK_CLI = "test"
411411
expect(await shouldOpenInExistingInstance(args)).toStrictEqual("test")
412412

413-
args.port = "8081"
414-
args._.push("./file")
413+
// hello world
414+
// args.port = "8081"
415+
// args._.push("./file")
415416
expect(await shouldOpenInExistingInstance(args)).toStrictEqual("test")
416417
})
417418

@@ -422,7 +423,7 @@ describe("cli", () => {
422423
await fs.writeFile(vscodeIpcPath, "test")
423424
await expect(shouldOpenInExistingInstance(args)).resolves.toStrictEqual("test")
424425

425-
args.port = "8081"
426+
// args.port = "8081"
426427
await expect(shouldOpenInExistingInstance(args)).resolves.toStrictEqual("test")
427428
})
428429

@@ -433,14 +434,14 @@ describe("cli", () => {
433434
await fs.writeFile(vscodeIpcPath, "test")
434435
expect(await shouldOpenInExistingInstance(args)).toStrictEqual("test")
435436

436-
args.port = "8081"
437+
// args.port = "8081"
437438
expect(await shouldOpenInExistingInstance(args)).toStrictEqual("test")
438439
})
439440

440441
it("should use existing if no unrelated flags are set, has positional, and socket is active", async () => {
441442
expect(await shouldOpenInExistingInstance(args)).toStrictEqual(undefined)
442443

443-
args._.push("./file")
444+
// args._.push("./file")
444445
expect(await shouldOpenInExistingInstance(args)).toStrictEqual(undefined)
445446

446447
const socketPath = path.join(testDir, "socket")
@@ -458,7 +459,7 @@ describe("cli", () => {
458459

459460
expect(await shouldOpenInExistingInstance(args)).toStrictEqual(socketPath)
460461

461-
args.port = "8081"
462+
// args.port = "8081"
462463
expect(await shouldOpenInExistingInstance(args)).toStrictEqual(undefined)
463464
})
464465
})

0 commit comments

Comments
 (0)