Skip to content

Commit 678f098

Browse files
committed
Don't show components info when tns doctor command is executed outside of project directory
1 parent 4c259e4 commit 678f098

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/services/versions-service.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ class VersionsService implements IVersionsService {
100100
allComponents.push(nativescriptCliInformation);
101101
}
102102

103-
const nativescriptCoreModulesInformation: IVersionInformation = await this.getTnsCoreModulesVersion();
104-
if (nativescriptCoreModulesInformation) {
105-
allComponents.push(nativescriptCoreModulesInformation);
106-
}
107-
108-
const runtimesVersions: IVersionInformation[] = await this.getRuntimesVersions();
103+
if (this.projectData) {
104+
const nativescriptCoreModulesInformation: IVersionInformation = await this.getTnsCoreModulesVersion();
105+
if (nativescriptCoreModulesInformation) {
106+
allComponents.push(nativescriptCoreModulesInformation);
107+
}
109108

110-
allComponents = allComponents.concat(runtimesVersions);
109+
const runtimesVersions: IVersionInformation[] = await this.getRuntimesVersions();
110+
allComponents = allComponents.concat(runtimesVersions);
111+
}
111112

112113
return allComponents
113114
.map(componentInformation => {

0 commit comments

Comments
 (0)