Skip to content

Commit

Permalink
fix: install code extensions on create (#1088)
Browse files Browse the repository at this point in the history
Signed-off-by: Toma Puljak <[email protected]>
  • Loading branch information
Tpuljak committed Sep 11, 2024
1 parent 505d2f1 commit bdddcde
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/workspace/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ var CreateCmd = &cobra.Command{
// Make sure terminal cursor is reset
fmt.Print("\033[?25h")

wsInfo, res, err := apiClient.WorkspaceAPI.GetWorkspace(ctx, workspaceName).Execute()
wsInfo, res, err := apiClient.WorkspaceAPI.GetWorkspace(ctx, workspaceName).Verbose(true).Execute()
if err != nil {
log.Fatal(apiclient_util.HandleErrorResponse(res, err))
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/ide/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ func OpenBrowserIDE(activeProfile config.Profile, workspaceId string, projectNam
log.Error("Error opening URL: " + err.Error())
}

if projectProviderMetadata == "" {
return nil
}

err = setupVSCodeCustomizations(projectHostname, projectProviderMetadata, devcontainer.Browser, "*/vscode-server/bin/openvscode-server", "$HOME/.openvscode-server/data/Machine/settings.json", ".daytona-customizations-lock-vscode-browser")
if err != nil {
log.Errorf("Error setting up IDE customizations: %s", err)
Expand Down
4 changes: 4 additions & 0 deletions pkg/ide/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func OpenCursor(activeProfile config.Profile, workspaceId string, projectName st
return err
}

if projectProviderMetadata == "" {
return nil
}

return setupVSCodeCustomizations(projectHostname, projectProviderMetadata, devcontainer.Vscode, "*/.cursor-server/*/bin/cursor-server", "$HOME/.cursor-server/data/Machine/settings.json", ".daytona-customizations-lock-cursor")
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/ide/vscode.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func OpenVSCode(activeProfile config.Profile, workspaceId string, projectName st
return err
}

if projectProviderMetadata == "" {
return nil
}

return setupVSCodeCustomizations(projectHostname, projectProviderMetadata, devcontainer.Vscode, "*/.vscode-server/*/bin/code-server", "$HOME/.vscode-server/data/Machine/settings.json", ".daytona-customizations-lock-vscode")
}

Expand Down

0 comments on commit bdddcde

Please sign in to comment.