Skip to content

Commit

Permalink
Do not ensure cordova plugins on add/revmoe
Browse files Browse the repository at this point in the history
  • Loading branch information
arbesfeld committed Aug 19, 2014
1 parent 8815083 commit 2d98dcd
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions tools/commands-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1559,9 +1559,10 @@ main.registerCommand({
}
}, function (options) {
// Special case on reserved package namespaces, such as 'cordova'
var cordovaPlugins;
try {
var filteredPackages = cordova.filterPackages(options.args);
var cordovaPlugins = filteredPackages.plugins;
cordovaPlugins = filteredPackages.plugins;

_.each(cordovaPlugins, function (plugin) {
cordova.checkIsValidPlugin(plugin);
Expand All @@ -1582,26 +1583,6 @@ main.registerCommand({
});
project.addCordovaPlugins(pluginsDict);

if (cordovaPlugins.length) {
var localPath = path.join(options.appDir, '.meteor', 'local');
files.mkdir_p(localPath);

var appName = path.basename(options.appDir);
cordova.ensureCordovaProject(localPath, appName);

// The plugins installation still can fail
try {
cordova.ensureCordovaPlugins(localPath);
} catch (err) {
project.removeCordovaPlugins(_.keys(project.getCordovaPlugins()));
project.addCordovaPlugins(oldPlugins);
// Print only the first line of error message, probably the rest is a
// stack trace.
process.stderr.write(err.message.split('\n')[0] + '\n');
return 1;
}
}

_.each(cordovaPlugins, function (plugin) {
process.stdout.write("added cordova plugin " + plugin + "\n");
});
Expand Down Expand Up @@ -1792,15 +1773,6 @@ main.registerCommand({
// Update the plugins list
project.removeCordovaPlugins(cordovaPlugins);

if (cordovaPlugins.length) {
var localPath = path.join(options.appDir, '.meteor', 'local');
files.mkdir_p(localPath);

var appName = path.basename(options.appDir);
cordova.ensureCordovaProject(localPath, appName);
cordova.ensureCordovaPlugins(localPath);
}

_.each(cordovaPlugins, function (plugin) {
process.stdout.write("removed cordova plugin " + plugin + "\n");
});
Expand Down

0 comments on commit 2d98dcd

Please sign in to comment.