From da35506c209ff70a0afd668c5c08fc66b05c1b3b Mon Sep 17 00:00:00 2001 From: Fatme Havaluova Date: Thu, 27 Aug 2015 16:49:48 +0300 Subject: [PATCH] Fix tns doctor command when javac is not added to PATH --- lib/common | 2 +- lib/services/doctor-service.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/common b/lib/common index b77ec28c3e..69ec643e18 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit b77ec28c3efff729381c226d096be4e538742e5b +Subproject commit 69ec643e18079674b64fcaa8d951c210fd9dccfa diff --git a/lib/services/doctor-service.ts b/lib/services/doctor-service.ts index 9983b862f9..6dba9ad7c2 100644 --- a/lib/services/doctor-service.ts +++ b/lib/services/doctor-service.ts @@ -1,7 +1,7 @@ /// "use strict"; import {EOL} from "os"; -import * as semver from "semver"; +import * as helpers from "../common/helpers"; class DoctorService implements IDoctorService { private static MIN_SUPPORTED_GRADLE_VERSION = "2.3"; @@ -70,7 +70,8 @@ class DoctorService implements IDoctorService { this.$logger.out("You will not be able to build your projects for Android or run them in the emulator or on a connected device." + EOL + "To be able to build for Android and run apps in the emulator on on a connected device, verify that you have installed Gradle."); } - if(sysInfo.gradleVer && semver.lt(sysInfo.gradleVer, DoctorService.MIN_SUPPORTED_GRADLE_VERSION)) { + + if(sysInfo.gradleVer && helpers.versionCompare(sysInfo.gradleVer, DoctorService.MIN_SUPPORTED_GRADLE_VERSION) === -1) { this.$logger.warn(`WARNING: Gradle version is lower than ${DoctorService.MIN_SUPPORTED_GRADLE_VERSION}.`); this.$logger.out("You will not be able to build your projects for Android or run them in the emulator or on a connected device." + EOL + `To be able to build for Android and run apps in the emulator on on a connected device, verify thqt you have at least ${DoctorService.MIN_SUPPORTED_GRADLE_VERSION} version installed.`);