Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cmd/open/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ type OpenStore interface {
GetWorkspace(workspaceID string) (*entity.Workspace, error)
GetWindowsDir() (string, error)
IsWorkspace() (bool, error)
GetAccessToken() (string, error)
}

func NewCmdOpen(t *terminal.Terminal, store OpenStore, noLoginStartStore OpenStore) *cobra.Command {
Expand Down Expand Up @@ -280,6 +281,9 @@ func handleSetDefault(t *terminal.Terminal, editorType string) error {

// Fetch workspace info, then open code editor
func runOpenCommand(t *terminal.Terminal, tstore OpenStore, wsIDOrName string, setupDoneString string, directory string, host bool, editorType string) error { //nolint:funlen,gocyclo // define brev command
if _, err := tstore.GetAccessToken(); err != nil {
return breverrors.WrapAndTrace(err)
}
// todo check if workspace is stopped and start if it if it is stopped
fmt.Println("finding your instance...")
res := refresh.RunRefreshAsync(tstore)
Expand Down
Loading