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 88EE517C1F for ; Tue, 14 Jul 2015 13:10:42 +0000 (UTC) Received: (qmail 56698 invoked by uid 500); 14 Jul 2015 13:10:42 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 56657 invoked by uid 500); 14 Jul 2015 13:10:42 -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 56646 invoked by uid 99); 14 Jul 2015 13:10:42 -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 13:10:41 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AA237E0254; Tue, 14 Jul 2015 13:10:41 +0000 (UTC) From: TimBarham 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: <20150714131041.AA237E0254@git1-us-west.apache.org> Date: Tue, 14 Jul 2015 13:10:41 +0000 (UTC) Github user TimBarham commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/259#discussion_r34565570 --- 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 -- Yep, realized that eventually - sorry about that :smile:. However, because ultimately the goal will be to replace the current prepare with browserify prepare , I'd prefer to keep this code simple and consistent with how browserify prepare works, and modify the `plugman.prepare` to return a promise. Then when the regular prepare goes away, we won't be left with unnecessary complexity here. --- 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