From 678f098606d24b1c98844f71606056c6746b86d9 Mon Sep 17 00:00:00 2001 From: fatme Date: Fri, 25 May 2018 14:12:13 +0300 Subject: [PATCH 1/2] Don't show components info when `tns doctor` command is executed outside of project directory --- lib/services/versions-service.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/services/versions-service.ts b/lib/services/versions-service.ts index c46fff5793..441f17dc6f 100644 --- a/lib/services/versions-service.ts +++ b/lib/services/versions-service.ts @@ -100,14 +100,15 @@ class VersionsService implements IVersionsService { allComponents.push(nativescriptCliInformation); } - const nativescriptCoreModulesInformation: IVersionInformation = await this.getTnsCoreModulesVersion(); - if (nativescriptCoreModulesInformation) { - allComponents.push(nativescriptCoreModulesInformation); - } - - const runtimesVersions: IVersionInformation[] = await this.getRuntimesVersions(); + if (this.projectData) { + const nativescriptCoreModulesInformation: IVersionInformation = await this.getTnsCoreModulesVersion(); + if (nativescriptCoreModulesInformation) { + allComponents.push(nativescriptCoreModulesInformation); + } - allComponents = allComponents.concat(runtimesVersions); + const runtimesVersions: IVersionInformation[] = await this.getRuntimesVersions(); + allComponents = allComponents.concat(runtimesVersions); + } return allComponents .map(componentInformation => { From 0f6fcc32f7783ddd78a47ad93bcb3b8dac4b85dd Mon Sep 17 00:00:00 2001 From: fatme Date: Fri, 25 May 2018 15:17:32 +0300 Subject: [PATCH 2/2] Don't print warnings messages twice when `tns doctor` command is executed and env is not correctly configured. --- lib/services/doctor-service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/services/doctor-service.ts b/lib/services/doctor-service.ts index 514614833c..556f859d04 100644 --- a/lib/services/doctor-service.ts +++ b/lib/services/doctor-service.ts @@ -34,12 +34,11 @@ class DoctorService implements IDoctorService { await this.$analyticsService.track("DoctorEnvironmentSetup", hasWarnings ? "incorrect" : "correct"); } - this.printInfosCore(infos); - if (hasWarnings) { this.$logger.info("There seem to be issues with your configuration."); } else { this.$logger.out("No issues were detected.".bold); + this.printInfosCore(infos); } try {