Skip to content

Commit a5efbab

Browse files
committed
Reverse authority parts check
1 parent f6bafef commit a5efbab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/remote.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ export class Remote {
4343
const sshAuthority = authorityParts[1].substring(Remote.Prefix.length)
4444

4545
// Authorities are in the format:
46-
// coder-vscode--<username>--<workspace>--<agent> Agent can be omitted then
47-
// will be prompted for instead.
46+
// coder-vscode--<username>--<workspace>--<agent>
47+
// The agent can be omitted; the user will be prompted for it instead.
4848
const parts = sshAuthority.split("--")
49-
if (parts.length < 2 || parts.length > 3) {
49+
if (parts.length !== 2 && parts.length !== 3) {
5050
throw new Error(`Invalid Coder SSH authority. Must be: <username>--<workspace>--<agent?>`)
5151
}
5252
const workspaceName = `${parts[0]}/${parts[1]}`

0 commit comments

Comments
 (0)