cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject cordova-lib git commit: CB-10461: 'cordova platform ls' should list the versions of platforms pinned
Date Fri, 05 Feb 2016 07:09:49 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 934947eea -> 78affa2de


CB-10461: 'cordova platform ls' should list the versions of platforms pinned

Added version information to available platforms list. The output will
be similar to:
Installed platforms:
  android 5.0.0
  blackberry10 3.8.0-dev
  browser 4.0.0
  firefoxos 3.6.3
  windows 4.2.0
  wp8 (deprecated)
Available platforms:
  amazon-fireos ~3.6.3 (deprecated)
  webos ~3.7.0
  windows8 ~4.2.0. This closes #376


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/78affa2d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/78affa2d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/78affa2d

Branch: refs/heads/master
Commit: 78affa2de0e7350e2b04758d344f97e03273336a
Parents: 934947e
Author: Sarangan Rajamanickam <sarajama@microsoft.com>
Authored: Wed Feb 3 10:58:00 2016 -0800
Committer: Vladimir Kotikov <v-vlkoti@microsoft.com>
Committed: Fri Feb 5 10:09:12 2016 +0300

----------------------------------------------------------------------
 cordova-lib/spec-cordova/platform.spec.js | 4 ++--
 cordova-lib/src/cordova/platform.js       | 8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/78affa2d/cordova-lib/spec-cordova/platform.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/platform.spec.js b/cordova-lib/spec-cordova/platform.spec.js
index 0b2210d..de3631a 100644
--- a/cordova-lib/spec-cordova/platform.spec.js
+++ b/cordova-lib/spec-cordova/platform.spec.js
@@ -79,14 +79,14 @@ describe('platform end-to-end', function () {
     // Factoring out some repeated checks.
     function emptyPlatformList() {
         return cordova.raw.platform('list').then(function() {
-            var installed = results.match(/Installed platforms: (.*)/);
+            var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBe(-1);
         });
     }
     function fullPlatformList() {
         return cordova.raw.platform('list').then(function() {
-            var installed = results.match(/Installed platforms: (.*)/);
+            var installed = results.match(/Installed platforms:\n  (.*)/);
             expect(installed).toBeDefined();
             expect(installed[1].indexOf(helpers.testPlatform)).toBeGreaterThan(-1);
         });

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/78affa2d/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js b/cordova-lib/src/cordova/platform.js
index 3776e30..a30b1b9 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -512,15 +512,19 @@ function list(hooksRunner, projectRoot, opts) {
         }));
     }).then(function(platformsText) {
         platformsText = addDeprecatedInformationToPlatforms(platformsText);
-        var results = 'Installed platforms: ' + platformsText.sort().join(', ') + '\n';
+        var results = 'Installed platforms:\n  ' + platformsText.sort().join('\n  ') + '\n';
         var available = Object.keys(platforms).filter(hostSupports);
 
         available = available.filter(function(p) {
             return platforms_on_fs.indexOf(p) < 0; // Only those not already installed.
         });
 
+        available = available.map(function (p){
+            return p.concat(' ', platforms[p].version);
+        });
+
         available = addDeprecatedInformationToPlatforms(available);
-        results += 'Available platforms: ' + available.sort().join(', ');        
+        results += 'Available platforms: \n  ' + available.sort().join('\n  ');
 
         events.emit('results', results);
     }).then(function() {


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


Mime
View raw message