Apache Cordova
  1. Apache Cordova
  2. CB-3050

Publicly Expose Platform Check Requirements

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.7.0
    • Component/s: CLI
    • Labels:
      None

      Description

      When using the cordova-cli as a node module, it is useful for the client to check platform support.

      Currently, the check_requirements(callback) function is available under /src/metadata/xxx_parser.js. This is only available to internal modules and cannot be publicly accessed.

        Activity

        Hide
        Michael Brooks added a comment -

        At the moment, the phonegap-cli augments the cordova-cli by adding the following interface:

        cordova.platform.supports(platform, callback);
        

        I'll review the various use-cases internal to cordova-cli and come up with an interface that works privately and publicly.

        Show
        Michael Brooks added a comment - At the moment, the phonegap-cli augments the cordova-cli by adding the following interface: cordova.platform.supports(platform, callback); I'll review the various use-cases internal to cordova-cli and come up with an interface that works privately and publicly.
        Hide
        Michael Brooks added a comment -

        Commit cbfe30

        The following interface is now exposed at the module-level:

        cordova.platform.supports(name, callback);
        

        A full example is as follows:

        cordova.platform.supports('android', function(e) {
          if (e) {
            // platform is unsupported
            // e is type Error
          }
        });
        
        Show
        Michael Brooks added a comment - Commit cbfe30 The following interface is now exposed at the module-level: cordova.platform.supports(name, callback); A full example is as follows: cordova.platform.supports('android', function(e) { if (e) { // platform is unsupported // e is type Error } });
        Hide
        Michael Brooks added a comment -

        cordova-cli@2.6.2 has been published to npm and includes the above changes.

        Show
        Michael Brooks added a comment - cordova-cli@2.6.2 has been published to npm and includes the above changes.

          People

          • Assignee:
            Michael Brooks
            Reporter:
            Michael Brooks
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development