Repository: cordova-lib Updated Branches: refs/heads/6.3.x 09ab5bbc7 -> a2736f594
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/63420225 Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/63420225 Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/63420225 Branch: refs/heads/6.3.x Commit: 634202255d1c0e86ed8845a673818e5add7d7b1b Parents: 09ab5bb Author: Darryl Pogue <dar...@ayogo.com> Authored: Fri Jul 15 11:23:27 2016 -0700 Committer: Vladimir Kotikov <v-vlk...@microsoft.com> Committed: Mon Aug 8 10:45:07 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/63420225/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/63420225/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-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org