Skip to content

Commit 9a40a6c

Browse files
fix: file paths from device logs should be correct with --path
When --path is used, the logs from the device are not mapped correctly to the local platform specific files. Fix the check if file exists in the project.
1 parent 52fb579 commit 9a40a6c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/common/test/unit-tests/mobile/device-log-provider.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ const createTestInjector = (): IInjector => {
3939
projectIdentifiers: {
4040
android: "org.nativescript.appTestLogs",
4141
ios: "org.nativescript.appTestLogs"
42-
}
42+
},
43+
projectDir: "projectDir"
4344
};
4445
},
4546
getNSValue: (projectDir: string, propertyName: string): any => {

lib/services/log-source-map-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class LogSourceMapService implements Mobile.ILogSourceMapService {
128128
const { dir, ext, name } = path.parse(sourceFile);
129129
const platformSpecificName = `${name}.${platform.toLowerCase()}`;
130130
const platformSpecificFile = path.format({ dir, ext, name: platformSpecificName });
131-
if (this.$fs.exists(platformSpecificFile)) {
131+
if (this.$fs.exists(path.join(projectData.projectDir, platformSpecificFile))) {
132132
this.originalFilesLocationCache[sourceFile] = platformSpecificFile;
133133
} else {
134134
this.originalFilesLocationCache[sourceFile] = sourceFile;

test/services/log-source-map-service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ function createTestInjector(): IInjector {
1919
projectIdentifiers: {
2020
android: "org.nativescript.sourceMap",
2121
ios: "org.nativescript.sourceMap"
22-
}
22+
},
23+
projectDir: "projectDir"
2324
};
2425
},
2526
getNSValue: (projectDir: string, propertyName: string): any => {

0 commit comments

Comments
 (0)