Remove pointless use of openInFlagCount
It'll always be zero here.
This commit is contained in:
parent
e0769dc13a
commit
466a04f874
@ -529,9 +529,10 @@ export const shouldOpenInExistingInstance = async (args: Args): Promise<string |
|
|||||||
}
|
}
|
||||||
|
|
||||||
// It's possible the user is trying to spawn another instance of code-server.
|
// It's possible the user is trying to spawn another instance of code-server.
|
||||||
// Check if any unrelated flags are set (add one for `_` which always exists),
|
// Check if any unrelated flags are set (check against one because `_` always
|
||||||
// that a file or directory was passed, and that the socket is active.
|
// exists), that a file or directory was passed, and that the socket is
|
||||||
if (Object.keys(args).length === openInFlagCount + 1 && args._.length > 0) {
|
// active.
|
||||||
|
if (Object.keys(args).length === 1 && args._.length > 0) {
|
||||||
const socketPath = await readSocketPath()
|
const socketPath = await readSocketPath()
|
||||||
if (socketPath && (await canConnect(socketPath))) {
|
if (socketPath && (await canConnect(socketPath))) {
|
||||||
return socketPath
|
return socketPath
|
||||||
|
Reference in New Issue
Block a user