Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1DC3817895 for ; Tue, 14 Jul 2015 11:21:37 +0000 (UTC) Received: (qmail 55295 invoked by uid 500); 14 Jul 2015 11:21:36 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 55254 invoked by uid 500); 14 Jul 2015 11:21:36 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 55243 invoked by uid 99); 14 Jul 2015 11:21:36 -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, 14 Jul 2015 11:21:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7DD20DFDF1; Tue, 14 Jul 2015 11:21:36 +0000 (UTC) From: giuseppelt To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-lib pull request: Fix prepare to wait the promise from plu... Content-Type: text/plain Message-Id: <20150714112136.7DD20DFDF1@git1-us-west.apache.org> Date: Tue, 14 Jul 2015 11:21:36 +0000 (UTC) Github user giuseppelt commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/259#discussion_r34558047 --- Diff: cordova-lib/src/cordova/prepare.js --- @@ -106,28 +106,29 @@ function prepare(options) { if (options.browserify) { plugman.prepare = require('../plugman/prepare-browserify'); } - plugman.prepare(platformPath, platform, plugins_dir, null, true, pluginInfoProvider); - - // Make sure that config changes for each existing plugin is in place - var platformJson = PlatformJson.load(plugins_dir, platform); - var munger = new PlatformMunger(platform, platformPath, plugins_dir, platformJson, pluginInfoProvider); - munger.reapply_global_munge(); - munger.save_all(); - - // Update platform config.xml based on top level config.xml - var cfg = new ConfigParser(xml); - var platform_cfg = new ConfigParser(parser.config_xml()); - exports._mergeXml(cfg.doc.getroot(), platform_cfg.doc.getroot(), platform, true); - - // CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures - // we allow using windows8 tag for new windows platform - if (platform == 'windows') { - exports._mergeXml(cfg.doc.getroot(), platform_cfg.doc.getroot(), 'windows8', true); - } - - platform_cfg.write(); - - return parser.update_project(cfg); + var preparePromise = plugman.prepare(platformPath, platform, plugins_dir, null, true, pluginInfoProvider); + return Q(preparePromise).then(function () { --- End diff -- I used Q, because I checked the standard plugman prepare, and it doesn't return a promise. Instead browserify prepare returns a promise. So, to avoid the edit of the standard prepare to add a last line of 'return q.resolve', I decided to wrap with Q to handle "to promise or to not promise" business. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org