Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C2544200B6F for ; Wed, 10 Aug 2016 01:27:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C13BE160AC1; Tue, 9 Aug 2016 23:27:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1A639160AB0 for ; Wed, 10 Aug 2016 01:27:34 +0200 (CEST) Received: (qmail 70909 invoked by uid 500); 9 Aug 2016 23:27:34 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 70842 invoked by uid 99); 9 Aug 2016 23:27:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2016 23:27:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C6B1FE1170; Tue, 9 Aug 2016 23:27:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Tue, 09 Aug 2016 23:27:34 -0000 Message-Id: In-Reply-To: <4916f27bc982496496597f7334b43e76@git.apache.org> References: <4916f27bc982496496597f7334b43e76@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [02/19] cordova-lib git commit: CB-11589: Fix missing plugin files after restore archived-at: Tue, 09 Aug 2016 23:27:35 -0000 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/common-1.4.x Commit: f05874a5420ea5fcf5b96290cb1a7fe18fe3e6d6 Parents: 1228fdc Author: Darryl Pogue Authored: Fri Jul 15 11:23:27 2016 -0700 Committer: Vladimir Kotikov 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