cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tim...@apache.org
Subject [16/17] git commit: [CB-4036] - fix for handling current state of platform branches with version listed as dev
Date Mon, 26 Aug 2013 23:47:50 GMT
[CB-4036] - fix for handling current state of platform branches with version listed as dev


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/0da4b356
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/0da4b356
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/0da4b356

Branch: refs/heads/master
Commit: 0da4b356eecc7c724dcc6c5eda02184b5f812939
Parents: d83ce8e
Author: Tim Kim <timk@adobe.com>
Authored: Mon Aug 26 15:58:43 2013 -0700
Committer: Tim Kim <timk@adobe.com>
Committed: Mon Aug 26 16:47:18 2013 -0700

----------------------------------------------------------------------
 src/install.js | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/0da4b356/src/install.js
----------------------------------------------------------------------
diff --git a/src/install.js b/src/install.js
index 13599e5..9934d82 100644
--- a/src/install.js
+++ b/src/install.js
@@ -77,7 +77,7 @@ function checkEngines(engines, callback) {
     });
 }
 
-function cleanVersionOutput(version, platform){
+function cleanVersionOutput(version, name){
     var out = version.trim();
     var rc_index = out.indexOf('rc');
     var dev_index = out.indexOf('dev');
@@ -87,8 +87,13 @@ function cleanVersionOutput(version, platform){
 
     // strip out the -dev and put a warning about using the dev branch
     if (dev_index > -1) {
-        out = out.substr(0, dev_index-1);
-        require('../plugman').emit('log', 'Cordova-'+platform+' has been detected as using
a development branch. Attemping to install as Cordova-'+platform+' '+out);
+        // some platform still lists dev branches as just dev, set to null and continue
+        if(out=="dev"){
+            out = null;
+        }else{
+            out = out.substr(0, dev_index-1);
+        }
+        require('../plugman').emit('log', name+' has been detected as using a development
branch. Attemping to install anyways.');
     }     
     return out;
 }
@@ -97,19 +102,19 @@ function cleanVersionOutput(version, platform){
 function callEngineScripts(engines) {
     var engineScript;
     var engineScriptVersion;
-    
+   
     engines.forEach(function(engine){
         if(fs.existsSync(engine.scriptSrc)){
             fs.chmodSync(engine.scriptSrc, '755');
             engineScript = shell.exec(engine.scriptSrc, {silent: true});
             if (engineScript.code === 0) {
-                engineScriptVersion = cleanVersionOutput(engineScript.output, engine.platform)
+                engineScriptVersion = cleanVersionOutput(engineScript.output, engine.name)
             }else{
                 engineScriptVersion = null;
                 require('../plugman').emit('log', 'Cordova project '+ engine.scriptSrc +'
script failed (has a '+ engine.scriptSrc +' script, but something went wrong executing it),
continuing anyways.');
             }  
         }else if(engine.currentVersion){
-            engineScriptVersion = cleanVersionOutput(engine.currentVersion, engine.platform)
          
+            engineScriptVersion = cleanVersionOutput(engine.currentVersion, engine.name)
          
         }else{
             engineScriptVersion = null;
             require('../plugman').emit('log', 'Cordova project '+ engine.scriptSrc +' not
detected (lacks a '+ engine.scriptSrc +' script), continuing.');


Mime
View raw message