File tree 3 files changed +16
-9
lines changed
server/@types/code-server-lib
3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,6 @@ bootstrap.enableASARSupport();
31
31
process . env [ 'VSCODE_CLI' ] = '1' ;
32
32
33
33
// Load CLI through AMD loader
34
- require ( './bootstrap-amd' ) . load ( 'vs/code/node/cli' ) ;
34
+ require ( './bootstrap-amd' ) . load ( 'vs/code/node/cli' , amdModule => {
35
+ amdModule . initialize ( ) ;
36
+ } ) ;
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import { createWaitMarkerFile } from 'vs/platform/environment/node/wait';
23
23
import product from 'vs/platform/product/common/product' ;
24
24
import { CancellationTokenSource } from 'vs/base/common/cancellation' ;
25
25
26
- function shouldSpawnCliProcess ( argv : NativeParsedArgs ) : boolean {
26
+ export function shouldSpawnCliProcess ( argv : NativeParsedArgs ) : boolean {
27
27
return ! ! argv [ 'install-source' ]
28
28
|| ! ! argv [ 'list-extensions' ]
29
29
|| ! ! argv [ 'install-extension' ]
@@ -433,9 +433,14 @@ function eventuallyExit(code: number): void {
433
433
setTimeout ( ( ) => process . exit ( code ) , 0 ) ;
434
434
}
435
435
436
- main ( process . argv )
437
- . then ( ( ) => eventuallyExit ( 0 ) )
438
- . then ( null , err => {
439
- console . error ( err . message || err . stack || err ) ;
440
- eventuallyExit ( 1 ) ;
441
- } ) ;
436
+ /**
437
+ * @coder Added so that code-server can invoke `main`.
438
+ */
439
+ export async function initialize ( ) {
440
+ return main ( process . argv )
441
+ . then ( ( ) => eventuallyExit ( 0 ) )
442
+ . then ( null , err => {
443
+ console . error ( err . message || err . stack || err ) ;
444
+ eventuallyExit ( 1 ) ;
445
+ } ) ;
446
+ }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ declare global {
34
34
* @deprecated This should be removed when code-server merges with lib/vscode
35
35
*/
36
36
export interface IMainCli {
37
- main : ( argv : NativeParsedArgs ) => Promise < void > ;
37
+ main : ( argv : NodeJS . Process [ 'argv' ] ) => Promise < void > ;
38
38
}
39
39
40
40
/**
You can’t perform that action at this time.
0 commit comments