cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ger...@apache.org
Subject [8/8] cordova-lib git commit: fix for options when calling prepare
Date Mon, 23 Feb 2015 22:30:00 GMT
fix for options when calling prepare

platform.js was calling the prepare with incorrect parameters. Fixed the parameters so
that they are options. Also fixed the indentation of prepare.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/1ebde74b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/1ebde74b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/1ebde74b

Branch: refs/heads/master
Commit: 1ebde74bcd2eb61d52c02eb5d910be88d45dc467
Parents: c1741ff
Author: Gorkem Ercan <gorkem.ercan@gmail.com>
Authored: Thu Feb 19 19:15:42 2015 -0500
Committer: Gorkem Ercan <gorkem.ercan@gmail.com>
Committed: Thu Feb 19 19:15:42 2015 -0500

----------------------------------------------------------------------
 cordova-lib/src/cordova/platform.js |  6 +++++-
 cordova-lib/src/cordova/prepare.js  | 18 +++++++++---------
 2 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1ebde74b/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js b/cordova-lib/src/cordova/platform.js
index 0ef7683..82eb3d1 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -152,7 +152,11 @@ function addHelper(cmd, hooksRunner, projectRoot, targets, opts) {
                 }).then(function() {
                     copy_cordova_js(projectRoot, platform);
                 }).then(function () {
-                    return require('./cordova').raw.prepare(platform);
+                    // Call prepare for the current platform.
+                    var prepOpts = {
+                        platforms :[platform]
+                    };
+                    return require('./cordova').raw.prepare(prepOpts);
                 }).then(function() {
                     if (cmd == 'add') {
                         return installPluginsForNewPlatform(platform, projectRoot, cfg, opts);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1ebde74b/cordova-lib/src/cordova/prepare.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/prepare.js b/cordova-lib/src/cordova/prepare.js
index 678d8ae..a956695 100644
--- a/cordova-lib/src/cordova/prepare.js
+++ b/cordova-lib/src/cordova/prepare.js
@@ -52,19 +52,19 @@ function prepare(options) {
     var hooksRunner = new HooksRunner(projectRoot);
     return hooksRunner.fire('before_prepare', options)
     .then(function(){
-      return restore.installPlatformsFromConfigXML(options.platforms);
+        return restore.installPlatformsFromConfigXML(options.platforms);
     })
     .then(function(){
-      options = cordova_util.preProcessOptions(options);
-      var paths = options.platforms.map(function(p) {
-        var platform_path = path.join(projectRoot, 'platforms', p);
-        var parser = (new platforms[p].parser(platform_path));
-        return parser.www_dir();
-      });
-      options.paths = paths;
+        options = cordova_util.preProcessOptions(options);
+        var paths = options.platforms.map(function(p) {
+            var platform_path = path.join(projectRoot, 'platforms', p);
+            var parser = (new platforms[p].parser(platform_path));
+            return parser.www_dir();
+        });
+        options.paths = paths;
     })
     .then(function(){
-      return restore.installPluginsFromConfigXML(options);
+        return restore.installPluginsFromConfigXML(options);
     })
     .then(function() {
         var pluginInfoProvider = new PluginInfoProvider();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message