Skip to content

Commit

Permalink
Keep standard stream names consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz authored Apr 16, 2022
1 parent 11f3aba commit aeb93a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions CliWrap/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private async Task PipeStandardInputAsync(
ProcessEx process,
CancellationToken cancellationToken = default)
{
await using (process.StdIn.WithAsyncDisposableAdapter())
await using (process.StandardInput.WithAsyncDisposableAdapter())
{
try
{
Expand All @@ -388,7 +388,7 @@ private async Task PipeStandardInputAsync(
// This is important with stdin because the process might finish before
// the pipe completes, and in case with infinite input stream it would
// normally result in a deadlock.
await StandardInputPipe.CopyToAsync(process.StdIn, cancellationToken)
await StandardInputPipe.CopyToAsync(process.StandardInput, cancellationToken)
.WithUncooperativeCancellation(cancellationToken)
.ConfigureAwait(false);
}
Expand All @@ -406,9 +406,9 @@ private async Task PipeStandardOutputAsync(
ProcessEx process,
CancellationToken cancellationToken = default)
{
await using (process.StdOut.WithAsyncDisposableAdapter())
await using (process.StandardOutput.WithAsyncDisposableAdapter())
{
await StandardOutputPipe.CopyFromAsync(process.StdOut, cancellationToken)
await StandardOutputPipe.CopyFromAsync(process.StandardOutput, cancellationToken)
.ConfigureAwait(false);
}
}
Expand All @@ -417,9 +417,9 @@ private async Task PipeStandardErrorAsync(
ProcessEx process,
CancellationToken cancellationToken = default)
{
await using (process.StdErr.WithAsyncDisposableAdapter())
await using (process.StandardError.WithAsyncDisposableAdapter())
{
await StandardErrorPipe.CopyFromAsync(process.StdErr, cancellationToken)
await StandardErrorPipe.CopyFromAsync(process.StandardError, cancellationToken)
.ConfigureAwait(false);
}
}
Expand Down
12 changes: 6 additions & 6 deletions CliWrap/Utils/ProcessEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ internal class ProcessEx : IDisposable
// We are purposely using Stream instead of StreamWriter/StreamReader to push the concerns of
// writing and reading to PipeSource/PipeTarget at the higher level.

public Stream StdIn { get; private set; } = Stream.Null;
public Stream StandardInput { get; private set; } = Stream.Null;

public Stream StdOut { get; private set; } = Stream.Null;
public Stream StandardOutput { get; private set; } = Stream.Null;

public Stream StdErr { get; private set; } = Stream.Null;
public Stream StandardError { get; private set; } = Stream.Null;

public int ExitCode { get; private set; }

Expand Down Expand Up @@ -92,9 +92,9 @@ public void Start()

// Copy metadata
Id = _nativeProcess.Id;
StdIn = _nativeProcess.StandardInput.BaseStream;
StdOut = _nativeProcess.StandardOutput.BaseStream;
StdErr = _nativeProcess.StandardError.BaseStream;
StandardInput = _nativeProcess.StandardInput.BaseStream;
StandardOutput = _nativeProcess.StandardOutput.BaseStream;
StandardError = _nativeProcess.StandardError.BaseStream;
}

public void Kill()
Expand Down

0 comments on commit aeb93a8

Please sign in to comment.