@@ -59,6 +59,14 @@ export class Application {
5959 SmokeTestLogger . info ( "Cannot clean up user data, will try it again in test setup." ) ;
6060 }
6161
62+ try {
63+ await this . cleanExtensionData ( ) ;
64+ } catch {
65+ SmokeTestLogger . info (
66+ "Cannot clean up extension data, will try it again in test setup." ,
67+ ) ;
68+ }
69+
6270 if ( this . app ) {
6371 await this . app . close ( ) ;
6472 this . app = null ;
@@ -76,7 +84,12 @@ export class Application {
7684
7785 extensionFile = path . join ( this . vsixDirectory , extensionFile ) ;
7886 args . push ( `--install-extension=${ extensionFile } ` ) ;
79- utilities . spawnSync ( cliPath , args , { stdio : "inherit" , shell : true } ) ;
87+
88+ if ( process . platform == "win32" ) {
89+ utilities . spawnSync ( cliPath , args , { stdio : "inherit" , shell : true } ) ;
90+ } else {
91+ utilities . spawnSync ( cliPath , args , { stdio : "inherit" } ) ;
92+ }
8093
8194 this . extension = new Extension ( ) ;
8295 return this . extension ;
@@ -97,4 +110,11 @@ export class Application {
97110 rimraf . sync ( this . userDataDirectory ) ;
98111 }
99112 }
113+
114+ async cleanExtensionData ( ) : Promise < void > {
115+ if ( fs . existsSync ( this . extensionDirectory ) ) {
116+ SmokeTestLogger . info ( `*** Deleting VS Code extension dir: ${ this . extensionDirectory } ` ) ;
117+ rimraf . sync ( this . extensionDirectory ) ;
118+ }
119+ }
100120}
0 commit comments