cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [06/43] git commit: Install all installed plugins into a newly added platform
Date Thu, 09 May 2013 23:00:08 GMT
Install all installed plugins into a newly added platform


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/2f398403
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/2f398403
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/2f398403

Branch: refs/heads/master
Commit: 2f398403a2601f9f2b94af46ea04334197e152d6
Parents: 19d6966
Author: Braden Shepherdson <braden.shepherdson@gmail.com>
Authored: Mon Apr 8 16:38:10 2013 -0400
Committer: Braden Shepherdson <braden.shepherdson@gmail.com>
Committed: Mon Apr 8 16:38:10 2013 -0400

----------------------------------------------------------------------
 src/platform.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/2f398403/src/platform.js
----------------------------------------------------------------------
diff --git a/src/platform.js b/src/platform.js
index 966a76f..7044fb4 100644
--- a/src/platform.js
+++ b/src/platform.js
@@ -101,6 +101,18 @@ module.exports = function platform(command, targets, callback) {
                             parser.update_project(cfg, function() {
                                 createOverrides(target);
                                 hooks.fire('after_platform_add');
+
+                                // Install all currently installed plugins into this new
platform.
+                                var pluginsDir = path.join(projectRoot, 'plugins');
+                                var plugins = fs.readdirSync(pluginsDir);
+                                plugins && plugins.forEach(function(plugin) {
+                                    var cli = path.join(__dirname, '..', 'node_modules',
'plugman', 'plugman.js');
+                                    var cmd = util.format('"%s" --platform "%s" --project
"%s" --plugin "%s" --plugins_dir "%s"', cli, target, output, path.basename(plugin), pluginsDir);
+                                    var result = shell.exec(cmd, { silent: true });
+                                    if (result.code > 0) {
+                                        throw new Error('An error occurred while installing
the ' + path.basename(plugin) + ' plugin: ' + result.output);
+                                    }
+                                });
                                 end();
                             });
                         });


Mime
View raw message