[
https://issues.apache.org/jira/browse/CB-6469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14152974#comment-14152974
]
ASF GitHub Bot commented on CB-6469:
------------------------------------
Github user sgrebnov commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/86#discussion_r18205524
--- Diff: cordova-lib/src/cordova/restore.js ---
@@ -70,29 +70,23 @@ function installPluginsFromConfigXML(cfg) {
}
return features.reduce(function(soFar, featureId) {
-
var pluginPath = path.join(plugins_dir, featureId);
if (fs.existsSync(pluginPath)) {
// Plugin already exists
return soFar;
}
-
return soFar.then(function() {
events.emit('log', 'Discovered ' + featureId + ' in
config.xml. Installing to the project');
-
var feature = cfg.getFeature(featureId);
// Install from given URL if defined or using a plugin id
- var installFrom = feature.url;
- if (!installFrom) {
- installFrom = feature.id;
- if (!!feature.version) {
- installFrom += ('@' + feature.version);
- }
+ var installFrom = feature.url || feature.installPath ||
feature.id;
+ if( feature.version && !feature.url && !feature.installPath ){
+ installFrom += ('@' + feature.version);
}
-
+ console.log('Install from ' + installFrom);
--- End diff --
It is better to use
events.emit('log', ...
> Restore plugins from config.xml
> -------------------------------
>
> Key: CB-6469
> URL: https://issues.apache.org/jira/browse/CB-6469
> Project: Apache Cordova
> Issue Type: New Feature
> Components: CLI
> Affects Versions: 3.4.0
> Reporter: Gorkem ERCAN
> Assignee: Gorkem ERCAN
>
> CLI should be able to restore plugins that are listed on the top level
> config.xml.
> Essentially an entry like below, should cause the
> org.apache.cordova.core.console plugin version 0.2.8 to be installed from
> registry. If version is omitted is should just use the latest available from
> registry.
> <feature name="Console">
> <param name="id" value="org.apache.cordova.core.console" />
> <param name="version" value="0.2.8" />
> </feature>
> Moreover we should add a save plugins command to save the currently installed
> plugins to config.xml
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)