You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2015/04/09 01:58:34 UTC
[3/3] cordova-lib git commit: CB-8775 adding a plugin will still copy
it to plugins folder, except ifthe plugin's new/old id is already there
CB-8775 adding a plugin will still copy it to plugins folder, except ifthe plugin's new/old id is already there
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/f6b54211
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/f6b54211
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/f6b54211
Branch: refs/heads/master
Commit: f6b54211f5f06754bbb6c9d8187948f80a767d17
Parents: 741aa02
Author: Steve Gill <st...@gmail.com>
Authored: Wed Apr 8 15:54:37 2015 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Wed Apr 8 16:15:57 2015 -0700
----------------------------------------------------------------------
cordova-lib/spec-plugman/fetch.spec.js | 6 +++---
cordova-lib/src/plugman/fetch.js | 10 ++--------
2 files changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f6b54211/cordova-lib/spec-plugman/fetch.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/fetch.spec.js b/cordova-lib/spec-plugman/fetch.spec.js
index cf38757..2bc0188 100644
--- a/cordova-lib/spec-plugman/fetch.spec.js
+++ b/cordova-lib/spec-plugman/fetch.spec.js
@@ -22,12 +22,12 @@ var fetch = require('../src/plugman/fetch'),
path = require('path'),
shell = require('shelljs'),
realrm = shell.rm,
- xml_helpers = require('../src/util/xml-helpers'),
+ //xml_helpers = require('../src/util/xml-helpers'),
metadata = require('../src/plugman/util/metadata'),
temp = path.join(os.tmpdir(), 'plugman', 'fetch'),
test_plugin = path.join(__dirname, 'plugins', 'org.test.plugins.childbrowser'),
- test_plugin_with_space = path.join(__dirname, 'folder with space', 'plugins', 'org.test.plugins.childbrowser'),
- test_plugin_xml = xml_helpers.parseElementtreeSync(path.join(test_plugin, 'plugin.xml')),
+ //test_plugin_with_space = path.join(__dirname, 'folder with space', 'plugins', 'org.test.plugins.childbrowser'),
+ //test_plugin_xml = xml_helpers.parseElementtreeSync(path.join(test_plugin, 'plugin.xml')),
test_plugin_id = 'org.test.plugins.childbrowser',
test_plugin_version ='0.6.0',
plugins = require('../src/plugman/util/plugins'),
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f6b54211/cordova-lib/src/plugman/fetch.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/fetch.js b/cordova-lib/src/plugman/fetch.js
index 0cf19be..199bbfc 100644
--- a/cordova-lib/src/plugman/fetch.js
+++ b/cordova-lib/src/plugman/fetch.js
@@ -240,7 +240,7 @@ function findLocalPlugin(plugin_src, searchpath, pluginInfoProvider) {
// Copy or link a plugin from plugin_dir to plugins_dir/plugin_id.
-// if plugin exists in plugins_dir/plugin_id, skip copy
+// if alternative ID of plugin exists in plugins_dir/plugin_id, skip copying
function copyPlugin(pinfo, plugins_dir, link) {
var plugin_dir = pinfo.dir;
@@ -250,16 +250,10 @@ function copyPlugin(pinfo, plugins_dir, link) {
//check if alternative id already exists in plugins directory
if(pluginMapperotn[pinfo.id]) {
altDest = path.join(plugins_dir, pluginMapperotn[pinfo.id]);
- }
- if(pluginMappernto[pinfo.id]) {
+ } else if(pluginMappernto[pinfo.id]) {
altDest = path.join(plugins_dir, pluginMappernto[pinfo.id]);
}
- if(fs.existsSync(dest)) {
- events.emit('log', pinfo.id + '" already exists in "' + dest + '"');
- return dest;
-
- }
if(fs.existsSync(altDest)) {
events.emit('log', pinfo.id + '" already exists in "' + altDest + '"');
return altDest;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org