Skip to content

pub [global] run doesn't redirect stdout/stderr? #23072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DartBot opened this issue Apr 1, 2015 · 7 comments
Closed

pub [global] run doesn't redirect stdout/stderr? #23072

DartBot opened this issue Apr 1, 2015 · 7 comments
Labels
needs-info We need additional information from the issue author (auto-closed after 14 days if no response)

Comments

@DartBot
Copy link

DartBot commented Apr 1, 2015

This issue was originally filed by @seaneagan


Tried doing:

pub run unittest:unittest > out.txt

The output gets printed to the console, and not to out.txt. Presumably pub run is not redirecting the stdout/stderr of the dart script it is running to its own stdout/stderr?

I'm on windows.

@DartBot
Copy link
Author

DartBot commented Apr 2, 2015

This comment was originally written by @zoechi


Probably similar to http://dartbug.com/21049

@DartBot
Copy link
Author

DartBot commented Apr 2, 2015

This comment was originally written by @zoechi


And probably a workaround for http://dartbug.com/21564 which should be fixed.

@DartBot
Copy link
Author

DartBot commented Apr 2, 2015

This comment was originally written by @seaneagan


I don't think it matters if the output of the process spawned by pub run is written synchonously or not, it should still be capturable by the calling process (pub run) via something like:

  Process.start(...)
    ..stdout.listen(stdout.write);
    ..stderr.listen(stderr.write);

Is pub [global] run already doing something like that?

@DartBot
Copy link
Author

DartBot commented Apr 2, 2015

This comment was originally written by @seaneagan


Actually, there's an example right in the docs for Process.start:

Process.start('grep', ['-i', 'main', 'test.dart']).then((process) {
  stdout.addStream(process.stdout);
  stderr.addStream(process.stderr);
});

@iposva-google
Copy link
Contributor

Added Area-Pub, Triaged labels.

@nex3
Copy link
Member

nex3 commented Apr 3, 2015

I can't reproduce this on Linux. It's piping the output just fine for me. What version of the SDK are you using? Can you reproduce this with a simple print statement in a script run via "pub run"? How about not run via "pub run"? Can you pipe just the stderr using "2>"?


Added NeedsInfo label.

@DartBot DartBot added Type-Defect needs-info We need additional information from the issue author (auto-closed after 14 days if no response) labels Apr 3, 2015
@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

This issue has been moved to dart-lang/pub#4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info We need additional information from the issue author (auto-closed after 14 days if no response)
Projects
None yet
Development

No branches or pull requests

4 participants