Skip to content

Commit 0cedf90

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #1195 from NativeScript/fatme/fix-doctor
Fix doctor command
2 parents 9d7a6b7 + 890cc8c commit 0cedf90

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/services/doctor-service.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,22 @@ class DoctorService implements IDoctorService {
4545
result = true;
4646
}
4747

48-
if(!sysInfo.cocoapodVer ) {
48+
if(!sysInfo.cocoapodVer) {
4949
this.$logger.warn("WARNING: CocoaPod is not installed or is not configured properly.");
5050
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
5151
+ "To be able to build such projects, verify that you have installed CocoaPod.");
5252
result = true;
5353
}
5454

55-
if(sysInfo.cocoapodVer && semver.lt(sysInfo.cocoapodVer, DoctorService.MIN_SUPPORTED_POD_VERSION)) {
56-
this.$logger.warn(`WARNING: CocoaPods version is lower than ${DoctorService.MIN_SUPPORTED_POD_VERSION}`);
55+
if (sysInfo.cocoapodVer && semver.valid(sysInfo.cocoapodVer) === null) {
56+
this.$logger.warn(`WARNING: CocoaPods version is not a valid semver version.`);
57+
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
58+
+ `To be able to build such projects, verify that you have at least ${DoctorService.MIN_SUPPORTED_POD_VERSION} version installed.`);
59+
result = true;
60+
}
61+
62+
if (sysInfo.cocoapodVer && semver.valid(sysInfo.cocoapodVer) && semver.lt(sysInfo.cocoapodVer, DoctorService.MIN_SUPPORTED_POD_VERSION)) {
63+
this.$logger.warn(`WARNING: CocoaPods version is lower than ${DoctorService.MIN_SUPPORTED_POD_VERSION}.`);
5764
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
5865
+ `To be able to build such projects, verify that you have at least ${DoctorService.MIN_SUPPORTED_POD_VERSION} version installed.`);
5966
result = true;

0 commit comments

Comments
 (0)