Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7A4991022F for ; Tue, 3 Jun 2014 14:09:02 +0000 (UTC) Received: (qmail 98631 invoked by uid 500); 3 Jun 2014 14:09:02 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 98610 invoked by uid 500); 3 Jun 2014 14:09:02 -0000 Mailing-List: contact issues-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 issues@cordova.apache.org Received: (qmail 98531 invoked by uid 99); 3 Jun 2014 14:09:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jun 2014 14:09:02 +0000 Date: Tue, 3 Jun 2014 14:09:02 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-5082) add BB10 support in doPlatform() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14016538#comment-14016538 ] ASF GitHub Bot commented on CB-5082: ------------------------------------ Github user martincgg commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/7#discussion_r13335471 --- 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 -- I can spell it correctly, no problem > add BB10 support in doPlatform() > -------------------------------- > > Key: CB-5082 > URL: https://issues.apache.org/jira/browse/CB-5082 > Project: Apache Cordova > Issue Type: Sub-task > Components: CLI > Reporter: Marcel Kinard > Assignee: Martin Gonzalez > Priority: Minor > -- This message was sent by Atlassian JIRA (v6.2#6252)