Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1747017646 for ; Mon, 20 Apr 2015 23:34:03 +0000 (UTC) Received: (qmail 5909 invoked by uid 500); 20 Apr 2015 23:34:03 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 5877 invoked by uid 500); 20 Apr 2015 23:34:03 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 5771 invoked by uid 99); 20 Apr 2015 23:34:02 -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; Mon, 20 Apr 2015 23:34:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CA971E0988; Mon, 20 Apr 2015 23:34:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shazron@apache.org To: commits@cordova.apache.org Date: Mon, 20 Apr 2015 23:34:03 -0000 Message-Id: <3f2a669d39ab4c1a919ab80aa4149024@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/3] ios commit: CB-8855 Fix display ios devices with --list (closes #137) CB-8855 Fix display ios devices with --list (closes #137) Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/078a47f3 Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/078a47f3 Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/078a47f3 Branch: refs/heads/4.0.x Commit: 078a47f3fa250b46b370d43530c040bf4f0ed5cd Parents: e659373 Author: Carlos Santana Authored: Tue Apr 14 17:08:06 2015 -0400 Committer: Shazron Abdullah Committed: Tue Apr 14 14:18:37 2015 -0700 ---------------------------------------------------------------------- bin/templates/scripts/cordova/lib/list-devices | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/078a47f3/bin/templates/scripts/cordova/lib/list-devices ---------------------------------------------------------------------- diff --git a/bin/templates/scripts/cordova/lib/list-devices b/bin/templates/scripts/cordova/lib/list-devices index ddeb0b5..f612096 100755 --- a/bin/templates/scripts/cordova/lib/list-devices +++ b/bin/templates/scripts/cordova/lib/list-devices @@ -36,14 +36,16 @@ function listDevices() { ]; // wrap al lexec calls into promises and wait until they're fullfilled - return Q.all(commands).then(function (promises) { + return Q.all(commands).then(function (results) { var accumulator = []; - promises.forEach(function (promise) { - if (promise.state === 'fulfilled') { - // Each command promise resolves with array [stout, stderr], and we need stdout only - // Append stdout lines to accumulator - accumulator.concat(promise.value[0].trim().split('\n')); - } + results.forEach(function (result) { + var devicefound; + // Each command promise resolves with array [stout, stderr], and we need stdout only + // Append stdout lines to accumulator + devicefound = result[0].trim().split('\n')[0]; + if(devicefound !== ''){ + accumulator.push(devicefound); + } }); return accumulator; }); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org