Skip to content

Commit 1cf5359

Browse files
committed
tns debug ios now works with custom inspector
1 parent 064d026 commit 1cf5359

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/services/ios-debug-service.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ class IOSDebugService implements IDebugService {
214214
private openAppInspector(fileDescriptor: string): IFuture<void> {
215215
if (this.$options.client) {
216216
return (() => {
217-
let inspectorPath = this.$npmInstallationManager.install(inspectorNpmPackageName, this.$projectData.projectDir, {dependencyType: "save-dev"}).wait();
217+
let inspectorPath = path.join(this.$projectData.projectDir, "node_modules", inspectorNpmPackageName);
218+
if(!this.inspectorAlreadyInstalled(inspectorPath).wait()) {
219+
inspectorPath = this.$npmInstallationManager.install(inspectorNpmPackageName, this.$projectData.projectDir, {dependencyType: "save-dev"}).wait();
220+
}
218221
let inspectorSourceLocation = path.join(inspectorPath, inspectorUiDir, "Main.html");
219222
let inspectorApplicationPath = path.join(inspectorPath, inspectorAppName);
220223

@@ -227,5 +230,14 @@ class IOSDebugService implements IDebugService {
227230
}).future<void>()();
228231
}
229232
}
233+
234+
private inspectorAlreadyInstalled(pathToInspector: string): IFuture<Boolean> {
235+
return (() => {
236+
if(this.$fs.exists(pathToInspector).wait()) {
237+
return true;
238+
}
239+
return false;
240+
}).future<Boolean>()();
241+
}
230242
}
231243
$injector.register("iOSDebugService", IOSDebugService);

0 commit comments

Comments
 (0)