cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject cordova-lib git commit: CB-11589: Fix missing plugin files after restore
Date Tue, 19 Jul 2016 06:18:11 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 1228fdc58 -> f05874a54


CB-11589: Fix missing plugin files after restore

 This closes #464


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

Branch: refs/heads/master
Commit: f05874a5420ea5fcf5b96290cb1a7fe18fe3e6d6
Parents: 1228fdc
Author: Darryl Pogue <darryl@ayogo.com>
Authored: Fri Jul 15 11:23:27 2016 -0700
Committer: Vladimir Kotikov <v-vlkoti@microsoft.com>
Committed: Tue Jul 19 09:17:20 2016 +0300

----------------------------------------------------------------------
 cordova-lib/src/cordova/platform.js | 24 ++++++++++++++----------
 cordova-lib/src/cordova/prepare.js  |  2 +-
 2 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f05874a5/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js b/cordova-lib/src/cordova/platform.js
index 95f1af5..680fb3b 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -193,22 +193,26 @@ function addHelper(cmd, hooksRunner, projectRoot, targets, opts) {
 
                 return promise()
                 .then(function () {
-                    return prepare.preparePlatforms([platform], projectRoot, { searchpath:
opts.searchpath });
+                    if (!opts.restoring) {
+                        return prepare.preparePlatforms([platform], projectRoot, { searchpath:
opts.searchpath });
+                    }
                 })
                 .then(function() {
-                    if (cmd == 'add') {
+                    if (cmd == 'add' && !opts.restoring) {
                         return installPluginsForNewPlatform(platform, projectRoot, opts);
                     }
                 })
                 .then(function () {
-                    // Call prepare for the current platform.
-                    var prepOpts = {
-                        platforms :[platform],
-                        searchpath :opts.searchpath,
-                        fetch: opts.fetch || false,
-                        save: opts.save || false
-                    };
-                    return require('./cordova').raw.prepare(prepOpts);
+                    if (!opts.restoring) {
+                        // Call prepare for the current platform if we're not restoring from
config.xml
+                        var prepOpts = {
+                            platforms :[platform],
+                            searchpath :opts.searchpath,
+                            fetch: opts.fetch || false,
+                            save: opts.save || false
+                        };
+                        return require('./cordova').raw.prepare(prepOpts);
+                    }
                 })
                 .then(function() {
                     var saveVersion = !spec || semver.validRange(spec, true);

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/f05874a5/cordova-lib/src/cordova/prepare.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/prepare.js b/cordova-lib/src/cordova/prepare.js
index ff4f119..00d50ad 100644
--- a/cordova-lib/src/cordova/prepare.js
+++ b/cordova-lib/src/cordova/prepare.js
@@ -43,7 +43,7 @@ function prepare(options) {
         var hooksRunner = new HooksRunner(projectRoot);
         return hooksRunner.fire('before_prepare', options)
         .then(function(){
-            return restore.installPlatformsFromConfigXML(options.platforms, { searchpath
: options.searchpath, fetch : options.fetch, save : options.save });
+            return restore.installPlatformsFromConfigXML(options.platforms, { searchpath
: options.searchpath, fetch : options.fetch, restoring : true });
         })
         .then(function(){
             options = cordova_util.preProcessOptions(options);


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


Mime
View raw message