Skip to content

Commit 0ac0278

Browse files
committed
Unzip NativeScript Inspector Application
Sadly $npmInstallationManager.install does not install the package, it only inserts it in the cache through the npm cache add command Since npm cache add command does not execute scripts our posinstall script that extract the Inspector Application does not execute as well So until this behavior is changed this ugly workaround should not be deleted
1 parent 0d3bc45 commit 0ac0278

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/services/ios-debug-service.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class IOSDebugService implements IDebugService {
3030
private $iOSNotification: IiOSNotification,
3131
private $iOSSocketRequestExecutor: IiOSSocketRequestExecutor,
3232
private $processService: IProcessService,
33-
private $socketProxyFactory: ISocketProxyFactory) {
33+
private $socketProxyFactory: ISocketProxyFactory,
34+
private $npm: INodePackageManager) {
3435
this.$processService.attachToProcessExitSignals(this, this.debugStop);
3536
}
3637

@@ -211,6 +212,13 @@ class IOSDebugService implements IDebugService {
211212
let inspectorSourceLocation = path.join(inspectorPath, inspectorUiDir, "Main.html");
212213
let inspectorApplicationPath = path.join(inspectorPath, inspectorAppName);
213214

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+
214222
let cmd = `open -a '${inspectorApplicationPath}' --args '${inspectorSourceLocation}' '${this.$projectData.projectName}' '${fileDescriptor}'`;
215223
this.$childProcess.exec(cmd).wait();
216224
}).future<void>()();

0 commit comments

Comments
 (0)