@@ -341,6 +341,48 @@ func (o *VsCodeServer) findServerBinaryPath(location string) string {
341
341
return binPath
342
342
}
343
343
344
+ if o .flavor == FlavorCodiumInsiders {
345
+ // check legacy location `$HOME/.vscodium-server-insiders/bin`
346
+ binDir := filepath .Join (location , "bin" )
347
+ for {
348
+ if time .Now ().After (deadline ) {
349
+ o .log .Warn ("Timed out installing vscodium-server-insiders" )
350
+ break
351
+ }
352
+ entries , err := os .ReadDir (binDir )
353
+ if err != nil || len (entries ) == 0 {
354
+ o .log .Infof ("Read dir %s: %v" , binDir , err )
355
+ o .log .Info ("Wait until vscodium-server-insiders is installed..." )
356
+ // check new location `$HOME/.vscodium-server-insiders/cli/servers/Stable-<version>/server/bin/code-server`
357
+ newBinPath , err := o .findCodeServerBinary (location )
358
+ if err != nil {
359
+ o .log .Infof ("Read new location %s: %v" , location , err )
360
+ o .log .Info ("Wait until vscodium is installed..." )
361
+ time .Sleep (time .Second * 3 )
362
+ continue
363
+ }
364
+
365
+ binPath = newBinPath
366
+ break
367
+ }
368
+
369
+ binPath = filepath .Join (binDir , entries [0 ].Name (), "bin" , "codium-server-insiders" )
370
+ ctx , cancel := context .WithTimeout (context .Background (), time .Second * 4 )
371
+ out , err := exec .CommandContext (ctx , binPath , "--help" ).CombinedOutput ()
372
+ cancel ()
373
+ if err != nil {
374
+ o .log .Infof ("Execute %s: %v" , binPath , command .WrapCommandError (out , err ))
375
+ o .log .Info ("Wait until vscodium-server-insiders is installed..." )
376
+ time .Sleep (time .Second * 3 )
377
+ continue
378
+ }
379
+
380
+ break
381
+ }
382
+
383
+ return binPath
384
+ }
385
+
344
386
if o .flavor == FlavorInsiders {
345
387
serversDir := filepath .Join (location , "cli" , "servers" )
346
388
for {
@@ -457,6 +499,8 @@ func prepareServerLocation(userName string, create bool, flavor Flavor) (string,
457
499
folderName = ".positron-server"
458
500
case FlavorCodium :
459
501
folderName = ".vscodium-server"
502
+ case FlavorCodiumInsiders :
503
+ folderName = ".vscodium-server-insiders"
460
504
}
461
505
462
506
folder := filepath .Join (homeFolder , folderName )
0 commit comments