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 C7F6018DEA for ; Tue, 2 Feb 2016 13:02:14 +0000 (UTC) Received: (qmail 11276 invoked by uid 500); 2 Feb 2016 13:01:40 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 11257 invoked by uid 500); 2 Feb 2016 13:01:40 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 11189 invoked by uid 99); 2 Feb 2016 13:01:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Feb 2016 13:01:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C34A72C14F7 for ; Tue, 2 Feb 2016 13:01:39 +0000 (UTC) Date: Tue, 2 Feb 2016 13:01:39 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-10052) Improve superspawn to allow to handle spawned process io streams 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-10052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15128210#comment-15128210 ] ASF GitHub Bot commented on CB-10052: ------------------------------------- Github user vladimir-kotikov commented on the pull request: https://github.com/apache/cordova-lib/pull/369#issuecomment-178564407 @dblotsky, is this good to go? > Improve superspawn to allow to handle spawned process io streams > ---------------------------------------------------------------- > > Key: CB-10052 > URL: https://issues.apache.org/jira/browse/CB-10052 > Project: Apache Cordova > Issue Type: Improvement > Components: CordovaCommon > Affects Versions: 1.0.0 > Reporter: Vladimir Kotikov > Assignee: Vladimir Kotikov > Fix For: 1.1.0 > > > Sometimes it is useful to process spawned process stdout and stderr in some way before out this to console. The current implementation of superspawn doesn't give a way to do this. One of the cases when this could be helpful - CB-9971 (see https://github.com/apache/cordova-android/pull/240 for some discussion). > The proposed approach is: > 1. Add ability to accept any valid stdio configuration, just like the original child_process.spawn does (https://nodejs.org/api/child_process.html#child_process_options_stdio) > 2. Give a way to caller to listen to stdout and stderr events. This might be implemented as resultant promise progress notification: > {code:JavaScript} > spawn('mycommand', [], {stdio: 'pipe'}) > .progress(function (stdio){ > if (stdio.stderr) { > console.error(stdio.stderr); > } > }) > .then(function(result){ > // do other stuff > }) > {code} > Another option is to return na object that implements both EventEmitter and Promise interfaces, so anybody might subscribe to its events. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org