@@ -23,28 +23,32 @@ async function main() {
2323 console . log ( '[DEBUG] cliPath:' , cliPath ) ;
2424 console . log ( '[DEBUG] args:' , args ) ;
2525 console . log ( '[DEBUG] cwd:' , path . dirname ( cliPath ) ) ;
26- const installResult = cp . spawnSync (
27- cliPath ,
28- [ ...args , '--install-extension' , PVSC_EXTENSION_ID_FOR_TESTS , PVSC_ENVS_EXTENSION_ID_FOR_TESTS ] ,
29- {
30- cwd : path . dirname ( cliPath ) ,
31- encoding : 'utf8' ,
32- stdio : 'inherit' ,
33- shell : true ,
34- } ,
35- ) ;
36- console . log ( '[DEBUG] installResult:' , installResult ) ;
37- if ( installResult . error ) {
38- console . error ( 'Extension installation error:' , installResult . error ) ;
39- }
40- if ( installResult . status !== 0 ) {
41- console . error ( `Extension installation failed with exit code: ${ installResult . status } ` ) ;
42- if ( installResult . stderr ) {
43- console . error ( '[DEBUG] stderr:' , installResult . stderr . toString ( ) ) ;
26+ try {
27+ const installResult = cp . spawnSync (
28+ cliPath ,
29+ [ ...args , '--install-extension' , PVSC_EXTENSION_ID_FOR_TESTS , PVSC_ENVS_EXTENSION_ID_FOR_TESTS ] ,
30+ {
31+ cwd : path . dirname ( cliPath ) ,
32+ encoding : 'utf8' ,
33+ stdio : 'inherit' ,
34+ shell : true ,
35+ } ,
36+ ) ;
37+ console . log ( '[DEBUG] installResult:' , installResult ) ;
38+ if ( installResult . error ) {
39+ console . error ( 'Extension installation error:' , installResult . error ) ;
4440 }
45- if ( installResult . stdout ) {
46- console . error ( '[DEBUG] stdout:' , installResult . stdout . toString ( ) ) ;
41+ if ( installResult . status !== 0 ) {
42+ console . error ( `Extension installation failed with exit code: ${ installResult . status } ` ) ;
43+ if ( installResult . stderr ) {
44+ console . error ( '[DEBUG] stderr:' , installResult . stderr . toString ( ) ) ;
45+ }
46+ if ( installResult . stdout ) {
47+ console . error ( '[DEBUG] stdout:' , installResult . stdout . toString ( ) ) ;
48+ }
4749 }
50+ } catch ( ex ) {
51+ console . error ( 'Exception during extension installation:' , ex ) ;
4852 }
4953 } else {
5054 console . log ( '[DEBUG] Non-Windows detected' ) ;
0 commit comments