You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/06/04 22:26:32 UTC

[1/2] git commit: 0.7.10

Updated Branches:
  refs/heads/master 8c9783a33 -> 4826d0dca


0.7.10


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

Branch: refs/heads/master
Commit: 4826d0dcaac9a6d502c0e3b7185708e65c2e470d
Parents: eb68e29
Author: Fil Maj <ma...@gmail.com>
Authored: Tue Jun 4 13:25:08 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Tue Jun 4 13:26:09 2013 -0700

----------------------------------------------------------------------
 package.json |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/4826d0dc/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 10341a4..85c83c7 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "author": "Andrew Lunny <al...@gmail.com>",
   "name": "plugman",
   "description": "install/uninstall Cordova plugins",
-  "version": "0.7.9",
+  "version": "0.7.10",
   "repository": {
     "type": "git",
     "url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"


[2/2] git commit: don't fail on undetected cordova version

Posted by fi...@apache.org.
don't fail on undetected cordova version


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

Branch: refs/heads/master
Commit: eb68e29ff8ee37ec0f4de58fee4d953e7e38235f
Parents: 8c9783a
Author: Brett Rudd <br...@gmail.com>
Authored: Wed May 29 15:22:49 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Tue Jun 4 13:26:09 2013 -0700

----------------------------------------------------------------------
 src/install.js |   61 ++++++++++++++++++++++++++++----------------------
 1 files changed, 34 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/eb68e29f/src/install.js
----------------------------------------------------------------------
diff --git a/src/install.js b/src/install.js
index ba9746f..f25f907 100644
--- a/src/install.js
+++ b/src/install.js
@@ -75,36 +75,43 @@ function runInstall(actions, platform, project_dir, plugin_dir, plugins_dir, opt
     
     // checking engine 
     // will there be a case for multiple engine support?
-    var engines = plugin_et.findall('engines/engine');
-    engines.forEach(function(engine){
-        if(engine.attrib["name"].toLowerCase() === "cordova"){
-            var engineVersion = engine.attrib["version"];
-            var versionPath = path.join(project_dir, 'cordova', 'version');
-            
-            // need to rethink this so I don't have to chmod anything
-            fs.chmodSync(versionPath, '755');
-            
-            var versionScript = shell.exec(versionPath, {silent: true});
-            if(versionScript.code>0){
-                var err = new Error('File missing: ' + versionPath);
-                if (callback) callback(err);
-                else throw err;           
-            }else{
-                // clean only versionScript.output since semver.clean strips out 
-                // the gt and lt operators
-                if(semver.satisfies(semver.clean(versionScript.output), engineVersion)){
-                    // engine ok!
-                    
+    
+    var versionPath = path.join(project_dir, 'cordova', 'version');
+    if (fs.existsSync(versionPath)) {
+        
+        // need to rethink this so I don't have to chmod anything
+        fs.chmodSync(versionPath, '755');
+        var versionScript = shell.exec(versionPath, {silent: true});
+        
+        var engines = plugin_et.findall('engines/engine');
+        engines.forEach(function(engine){
+            if(engine.attrib["name"].toLowerCase() === "cordova"){
+                var engineVersion = engine.attrib["version"];
+                if(versionScript.code>0){
+                    var err = new Error('File missing: ' + versionPath);
+                    if (callback) callback(err);
+                    else throw err;
                 }else{
-                    var err = new Error('Plugin doesn\'t support Cordova version. Check plugin.xml');
-                if (callback) callback(err);
-                    else throw err; 
+                    // clean only versionScript.output since semver.clean strips out 
+                    // the gt and lt operators
+                    if(semver.satisfies(semver.clean(versionScript.output), engineVersion)){
+                        // engine ok!
+                    
+                    }else{
+                        var err = new Error('Plugin doesn\'t support Cordova version. Check plugin.xml');
+                    if (callback) callback(err);
+                        else throw err; 
+                    }
                 }
+            } else {
+                // check for other engines?
             }
-        }else{
-            // check for other engines?
-        }
-    });
+        });
+    } 
+    else
+    {
+        console.log('Warning: cordova version not detected. installing anyway.');
+    }
 
     // checking preferences, if certain variables are not provided, we should throw.
     prefs = plugin_et.findall('./preference') || [];