@@ -13,10 +13,10 @@ import (
1313)
1414
1515func Open (ctx context.Context , workspace , folder string , newWindow bool , flavor Flavor , log log.Logger ) error {
16- log .Infof ("Starting VSCode ..." )
16+ log .Infof ("Starting %s ..." , flavor )
1717 err := openViaCLI (ctx , workspace , folder , newWindow , flavor , log )
1818 if err != nil {
19- log .Debugf ("Error opening vscode via cli: %v" , err )
19+ log .Debugf ("Error opening %s via cli: %v" , flavor , err )
2020 } else {
2121 return nil
2222 }
@@ -56,7 +56,7 @@ func openViaCLI(ctx context.Context, workspace, folder string, newWindow bool, f
5656 // try to find code cli
5757 codePath := findCLI (flavor )
5858 if codePath == "" {
59- return fmt .Errorf ("couldn't find the code binary" )
59+ return fmt .Errorf ("couldn't find the %s binary" , flavor )
6060 }
6161
6262 // make sure ms-vscode-remote.remote-ssh is installed
@@ -98,7 +98,7 @@ func openViaCLI(ctx context.Context, workspace, folder string, newWindow bool, f
9898 // Needs to be separated by `=` because of windows
9999 folderUriArg := fmt .Sprintf ("--folder-uri=vscode-remote://ssh-remote+%s.devpod/%s" , workspace , folder )
100100 args = append (args , folderUriArg )
101- log .Debugf ("Run vscode command %s %s" , codePath , strings .Join (args , " " ))
101+ log .Debugf ("Run %s command %s %s" , flavor , codePath , strings .Join (args , " " ))
102102 out , err = exec .CommandContext (ctx , codePath , args ... ).CombinedOutput ()
103103 if err != nil {
104104 return command .WrapCommandError (out , err )
@@ -128,7 +128,7 @@ func findCLI(flavor Flavor) string {
128128 return ""
129129 }
130130
131- if flavor == FlavorInsiders {
131+ if flavor == FlavorCursor {
132132 if command .Exists ("cursor" ) {
133133 return "cursor"
134134 } else if runtime .GOOS == "darwin" && command .Exists ("/Applications/Cursor.app/Contents/Resources/app/bin/cursor" ) {
@@ -138,5 +138,15 @@ func findCLI(flavor Flavor) string {
138138 return ""
139139 }
140140
141+ if flavor == FlavorPositron {
142+ if command .Exists ("positron" ) {
143+ return "positron"
144+ } else if runtime .GOOS == "darwin" && command .Exists ("/Applications/Positron.app/Contents/Resources/app/bin/positron" ) {
145+ return "/Applications/Positron.app/Contents/Resources/app/bin/positron"
146+ }
147+
148+ return ""
149+ }
150+
141151 return ""
142152}
0 commit comments