@@ -30,7 +30,8 @@ class IOSDebugService implements IDebugService {
30
30
private $iOSNotification : IiOSNotification ,
31
31
private $iOSSocketRequestExecutor : IiOSSocketRequestExecutor ,
32
32
private $processService : IProcessService ,
33
- private $socketProxyFactory : ISocketProxyFactory ) {
33
+ private $socketProxyFactory : ISocketProxyFactory ,
34
+ private $npm : INodePackageManager ) {
34
35
this . $processService . attachToProcessExitSignals ( this , this . debugStop ) ;
35
36
}
36
37
@@ -211,6 +212,13 @@ class IOSDebugService implements IDebugService {
211
212
let inspectorSourceLocation = path . join ( inspectorPath , inspectorUiDir , "Main.html" ) ;
212
213
let inspectorApplicationPath = path . join ( inspectorPath , inspectorAppName ) ;
213
214
215
+ // TODO : Sadly $npmInstallationManager.install does not install the package, it only inserts it in the cache through the npm cache add command
216
+ // Since npm cache add command does not execute scripts our posinstall script that extract the Inspector Application does not execute as well
217
+ // So until this behavior is changed this ugly workaround should not be deleted
218
+ if ( ! this . $fs . exists ( inspectorApplicationPath ) . wait ( ) ) {
219
+ this . $npm . executeNpmCommand ( "npm run-script postinstall" , inspectorPath ) . wait ( ) ;
220
+ }
221
+
214
222
let cmd = `open -a '${ inspectorApplicationPath } ' --args '${ inspectorSourceLocation } ' '${ this . $projectData . projectName } ' '${ fileDescriptor } '` ;
215
223
this . $childProcess . exec ( cmd ) . wait ( ) ;
216
224
} ) . future < void > ( ) ( ) ;
0 commit comments