cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TimBarham <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: Fix prepare to wait the promise from plu...
Date Tue, 14 Jul 2015 10:54:05 GMT
Github user TimBarham commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/259#discussion_r34556418
  
    --- 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 --
    
    Since plugman.prepare() returns a promise, you should just be able to do this:
    
    ```js
    return plugman.prepare(platformPath, platform, plugins_dir, null, true, pluginInfoProvider)
    .then(function () {
    ```
    



---
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


Mime
View raw message