You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/19 16:46:37 UTC

[GitHub] [cordova-ios] erisu commented on a change in pull request #719: Add check for newer versions of cocoapods to avoid locking adding platforms on non synced pods repo

erisu commented on a change in pull request #719: Add check for newer versions of cocoapods to avoid locking adding platforms on non synced pods repo
URL: https://github.com/apache/cordova-ios/pull/719#discussion_r348041591
 
 

 ##########
 File path: bin/templates/scripts/cordova/lib/check_reqs.js
 ##########
 @@ -121,6 +121,20 @@ module.exports.check_cocoapods = function (toolChecker) {
         // check whether the cocoapods repo has been synced through `pod repo` command
         // a value of '0 repos' means it hasn't been synced
         .then(function (toolOptions) {
+            let podVersion = shell.exec('pod --version', { silent: true });
+            if (podVersion) {
+                const semver = podVersion.toString().split('.');
+                if (semver.length >= 3) {
+                    const major = parseInt(semver[0]);
+                    const minor = parseInt(semver[1]);
+                    const patch = parseInt(semver[2]);
+
+                    // starting with 1.8.0 cocoapods now use cdn and we dont need to sync first
+                    if ((major >= 1 && minor >= 8 && patch >= 0) || toolOptions.ignore) {
+                        return Q.resolve(toolOptions);
+                    }
 
 Review comment:
   I would recommend two thing.
   
   1. Use the `semver` dependency that we already include with `cordova-ios`.
   2. Return a native promise instead of using `Q`. We are removing the `Q` dependency in next major.
   
   Example:
   
   ```js
   const semver = require('semver');
   
   if (semver.satisfies(`>=${podVersion.toString()}`) || toolOptions.ignore) {
       return Promise.resolve(toolOptions)
   }
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org