Skip to content

Commit 9877483

Browse files
committed
Remove pointless use of openInFlagCount
It'll always be zero here.
1 parent 82b7909 commit 9877483

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/node/cli.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,10 @@ export const shouldOpenInExistingInstance = async (args: Args): Promise<string |
486486
}
487487

488488
// It's possible the user is trying to spawn another instance of code-server.
489-
// Check if any unrelated flags are set (add one for `_` which always exists),
490-
// that a file or directory was passed, and that the socket is active.
491-
if (Object.keys(args).length === openInFlagCount + 1 && args._.length > 0) {
489+
// Check if any unrelated flags are set (check against one because `_` always
490+
// exists), that a file or directory was passed, and that the socket is
491+
// active.
492+
if (Object.keys(args).length === 1 && args._.length > 0) {
492493
const socketPath = await readSocketPath()
493494
if (socketPath && (await canConnect(socketPath))) {
494495
return socketPath

0 commit comments

Comments
 (0)