Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-ios/pull/126#discussion_r23304037
  
    --- Diff: bin/lib/versions.js ---
    @@ -85,17 +85,59 @@ exports.get_apple_xcode_version = function() {
         child_process.exec('xcodebuild -version', function(error, stdout, 
stderr) {
             if (error) {
                 d.reject(stderr);
    +        } else {
    +            var version = stdout.split('\n')[0].slice(6);
    +            d.resolve(version);
             }
    -        else {
    +    });
    +    return d.promise;
    +};
    +
    +/**
    + * Gets ios-deploy util version
    + * @return {Promise} Promise that either resolved with ios-deploy version
    + *                           or rejected in case of error
    + */
    +exports.get_ios_deploy_version = function() {
    +    var d = Q.defer();
    +    child_process.exec('ios-deploy --version', function(error, stdout, 
stderr) {
    +        if (error) {
    +            d.reject(stderr);
    +        } else {
                 d.resolve(stdout);
             }
         });
    +    return d.promise;
    +};
     
    -    return d.promise.then(function(output) {
    -        output = output.split('\n');
    -        console.log(output[0].slice(6));
    -        return Q();
    -    }, function(stderr) {
    -        return Q.reject(stderr);
    +/**
    + * Gets ios-sim util version
    + * @return {Promise} Promise that either resolved with ios-sim version
    + *                           or rejected in case of error
    + */
    +exports.get_ios_sim_version = function() {
    +    var d = Q.defer();
    +    child_process.exec('ios-sim --version', function(error, stdout, 
stderr) {
    +        if (error) {
    +            d.reject(stderr);
    +        } else {
    +            d.resolve(stdout);
    +        }
         });
    -}
    +    return d.promise;
    +};
    +
    +/**
    + * Gets specific tool version
    + * @param  {String} toolName Tool name to check. Known tools are 
'xcodebuild', 'ios-sim' and 'ios-deploy'
    + * @return {Promise}         Promise that either resolved with tool version
    + *                                   or rejected in case of error
    + */
    +exports.get_tool_version = function (toolName) {
    +    switch (toolName) {
    +        case 'xcodebuild': return exports.get_apple_xcode_version();
    +        case 'ios-sim': return exports.get_apple_xcode_version();
    --- End diff --
    
    these two are pointing to the wrong function.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to