Skip to content

Commit 466a04f

Browse files
committed
Remove pointless use of openInFlagCount
It'll always be zero here.
1 parent e0769dc commit 466a04f

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
@@ -529,9 +529,10 @@ export const shouldOpenInExistingInstance = async (args: Args): Promise<string |
529529
}
530530

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

0 commit comments

Comments
 (0)