Skip to content

Commit 9370cf7

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #821 from NativeScript/fatme/fix-tns-doctor
Fix tns doctor command when javac is not added to PATH
2 parents 752112c + da35506 commit 9370cf7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/common

Submodule common updated 1 file

lib/services/doctor-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
///<reference path="../.d.ts"/>
22
"use strict";
33
import {EOL} from "os";
4-
import * as semver from "semver";
4+
import * as helpers from "../common/helpers";
55

66
class DoctorService implements IDoctorService {
77
private static MIN_SUPPORTED_GRADLE_VERSION = "2.3";
@@ -70,7 +70,8 @@ class DoctorService implements IDoctorService {
7070
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
7171
+ "To be able to build for Android and run apps in the emulator on on a connected device, verify that you have installed Gradle.");
7272
}
73-
if(sysInfo.gradleVer && semver.lt(sysInfo.gradleVer, DoctorService.MIN_SUPPORTED_GRADLE_VERSION)) {
73+
74+
if(sysInfo.gradleVer && helpers.versionCompare(sysInfo.gradleVer, DoctorService.MIN_SUPPORTED_GRADLE_VERSION) === -1) {
7475
this.$logger.warn(`WARNING: Gradle version is lower than ${DoctorService.MIN_SUPPORTED_GRADLE_VERSION}.`);
7576
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
7677
+ `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.`);

0 commit comments

Comments
 (0)