Skip to content

Commit

Permalink
fixed pr changes for host
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerfong authored and theFong committed Feb 25, 2024
1 parent 932a54d commit 895efc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/open/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func runOpenCommand(t *terminal.Terminal, tstore OpenStore, wsIDOrName string, s

localIdentifier := workspace.GetLocalIdentifier()
if host {
localIdentifier += "-host"
localIdentifier = workspace.GetHostIdentifier()
}

err = res.Await()
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func runShellCommand(t *terminal.Terminal, sstore ShellStore, workspaceNameOrID,

localIdentifier := workspace.GetLocalIdentifier()
if host {
localIdentifier += "-host"
localIdentifier = workspace.GetHostIdentifier()
}

sshName := string(localIdentifier)
Expand Down
4 changes: 4 additions & 0 deletions pkg/entity/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ func (w Workspace) GetLocalIdentifier() WorkspaceLocalID {
return w.createSimpleName()
}

func (w Workspace) GetHostIdentifier() WorkspaceLocalID {
return w.createSimpleName() + "-host"
}

func MakeIDSuffix(id string) string {
return id[len(id)-4:]
}
Expand Down

0 comments on commit 895efc4

Please sign in to comment.