Skip to content

Unzip NativeScript Inspector Application #2172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/services/ios-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class IOSDebugService implements IDebugService {
private $iOSNotification: IiOSNotification,
private $iOSSocketRequestExecutor: IiOSSocketRequestExecutor,
private $processService: IProcessService,
private $socketProxyFactory: ISocketProxyFactory) {
private $socketProxyFactory: ISocketProxyFactory,
private $npm: INodePackageManager) {
this.$processService.attachToProcessExitSignals(this, this.debugStop);
}

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

// TODO : 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
if (!this.$fs.exists(inspectorApplicationPath).wait()) {
this.$npm.executeNpmCommand("npm run-script postinstall", inspectorPath).wait();
}

let cmd = `open -a '${inspectorApplicationPath}' --args '${inspectorSourceLocation}' '${this.$projectData.projectName}' '${fileDescriptor}'`;
this.$childProcess.exec(cmd).wait();
}).future<void>()();
Expand Down