Github user jsoref commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/7#discussion_r13311181
--- Diff: cordova-lib/src/cordova/info.js ---
@@ -31,23 +31,50 @@ var cordova_util = require('./util'),
// Execute using a child_process exec, for any async command
function execSpawn(command, args, resultMsg, errorMsg) {
- return superspawn.spawn(command, args).then(function(result) {
+ return superspawn.spawn(command, args).then(function (result) {
return resultMsg + result;
- }, function(error) {
+ }, function (error) {
return errorMsg + error;
});
}
+//Collects data from promise, and it returns a promise
+function preparePromise(promise, headline) {
+ var output = "";
+ resultList = promise.state === 'fullfilled' ? promise.value :
promise.reason;
+ if (resultList.length > 0) {
+ resultList.map(function (result) {
+ output += result.name + ' ip: ' + result.ip + '\n';
+ });
+ return Q(headline + ':\n' + output);
+ }
+ return Q(headline + ':\n' + 'Not found');
+}
+
function getPlatformInfo(platform, projectRoot) {
switch (platform) {
case 'ios':
return execSpawn('xcodebuild', ['-version'], 'iOS platform:\n\n',
'Error retrieving iOS platform information: ');
case 'android':
return execSpawn('android', ['list', 'target'], 'Android
platform:\n\n', 'Error retrieving Android platform information: ');
+ case 'blackberry10':
+ var bbUtilsPath = path.join(projectRoot, 'platforms', platform,
'cordova');
+ return Q.allSettled([
+ Q.nfcall(require(path.join(bbUtilsPath, 'lib',
'target-utils')).getTargetList, 'emulator', false),
+ Q.nfcall(require(path.join(bbUtilsPath, 'lib',
'target-utils')).getTargetList, 'device', false)
+ ]).spread(function (emu, dev) {
+ return Q.all([
+ execSpawn(path.join(bbUtilsPath,'bb10-ndk-version'),
'', 'Blackberry 10 Native SDK version: ', 'Error retrieving Blackberry 10
Native SDK version'),
+ preparePromise(emu, 'Blackberry 10 deployed
emulators:'),
--- End diff --
Please spell BlackBerry correctly
---
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 [email protected] or file a JIRA ticket
with INFRA.
---