cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cordova-lib git commit: CB-9188 Confusing error after delete plugin folder then prepare.
Date Tue, 16 Jun 2015 18:00:24 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 8d67d2877 -> 52c0fef78


CB-9188 Confusing error after delete plugin folder then prepare.

Catch this scenario and display a useful message.


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

Branch: refs/heads/master
Commit: 52c0fef7883a241de77b267bd0c5d1b6c4ce9fe5
Parents: 8d67d28
Author: Tim Barham <tim.barham@microsoft.com>
Authored: Tue Jun 16 10:13:18 2015 -0700
Committer: Tim Barham <tim.barham@microsoft.com>
Committed: Tue Jun 16 10:38:40 2015 -0700

----------------------------------------------------------------------
 cordova-lib/src/PluginInfo.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/52c0fef7/cordova-lib/src/PluginInfo.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/PluginInfo.js b/cordova-lib/src/PluginInfo.js
index a6ea7ce..3190d95 100644
--- a/cordova-lib/src/PluginInfo.js
+++ b/cordova-lib/src/PluginInfo.js
@@ -29,6 +29,7 @@ TODO (kamrik): refactor this to not use sync functions and return promises.
 
 
 var path = require('path')
+  , fs = require('fs')
   , xml_helpers = require('./util/xml-helpers')
   , CordovaError = require('./CordovaError')
   ;
@@ -315,6 +316,9 @@ function PluginInfo(dirname) {
 
     ///// PluginInfo Constructor logic  /////
     self.filepath = path.join(dirname, 'plugin.xml');
+    if (!fs.existsSync(self.filepath)) {
+        throw new CordovaError('Cannot find plugin.xml for plugin \'' + path.basename(dirname)
+ '\'. Please try adding it again.');
+    }
 
     self.dir = dirname;
     var et = self._et = xml_helpers.parseElementtreeSync(self.filepath);


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


Mime
View raw message