From e9a352f22c178ab93b65d4e2cb09f06be7651978 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Mon, 6 Oct 2014 13:56:57 -0700 Subject: [PATCH] More buildmessage around installing cordova plugins --- tools/commands-cordova.js | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/tools/commands-cordova.js b/tools/commands-cordova.js index 75f9214e80..134c35c007 100644 --- a/tools/commands-cordova.js +++ b/tools/commands-cordova.js @@ -633,24 +633,27 @@ var ensureCordovaPlugins = function (localPath, options) { files.rm_recursive(path.join(cordovaPath, 'platforms')); ensureCordovaPlatforms(localPath); }; - Console.stdout.write("Initializing Cordova plugins...\n"); - uninstallAllPlugins(); + Console.info("Initializing Cordova plugins..."); - // Now install all of the plugins. - try { - // XXX: forkJoin with parallel false? - _.each(plugins, function (version, name) { - buildmessage.enterJob({ title: 'Installing Cordova plugin ' + name}, function () { - installPlugin(cordovaPath, name, version, pluginsConfiguration[name]); - }); - }); - } catch (err) { - // If a plugin fails to install, then remove all plugins and throw the - // error. Cordova doesn't remove the plugin by default for some reason. - // XXX don't throw and improve this error message. + buildmessage.enterJob({ title: "Initializing Cordova plugins..."}, function () { uninstallAllPlugins(); - throw err; - } + + // Now install all of the plugins. + try { + // XXX: forkJoin with parallel false? + _.each(plugins, function (version, name) { + buildmessage.enterJob({ title: 'Installing Cordova plugin ' + name}, function () { + installPlugin(cordovaPath, name, version, pluginsConfiguration[name]); + }); + }); + } catch (err) { + // If a plugin fails to install, then remove all plugins and throw the + // error. Cordova doesn't remove the plugin by default for some reason. + // XXX don't throw and improve this error message. + uninstallAllPlugins(); + throw err; + } + }); } };