Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
27 | Fixed the output writed (#27)
Browse files Browse the repository at this point in the history
* 27 | Fixed the output writer (Close #27)
* package version updated
  • Loading branch information
ivanparvaresh authored May 23, 2020
1 parent 6bcdaa8 commit 0344cc9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Services/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class Executor : IExecutor
public Executor()
{
this.forwardStdOut = true;
this.OutWriter = Console.Out;
this.ErrorWriter = Console.Error;
}
public Executor(TextWriter outWriter, TextWriter errorWriter)
{
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-exec.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
<PackageId>dotnet-tool-exec</PackageId>
<PackageVersion>1.2.0</PackageVersion>
<PackageVersion>2.0.3</PackageVersion>

<Description>Execute custom commands by dotnet</Description>
<PackageType>DotnetCliTool</PackageType>
Expand Down
9 changes: 9 additions & 0 deletions test/ExecutorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ namespace Ivanize.DotnetTool.Exec.Test
{
public class ExecutorTest
{
[Fact]
public void Constructor_Should_Use_Console_As_Ouput_Writers()
{
var executor = new Executor();


Assert.Equal(executor.ErrorWriter, Console.Error);
Assert.Equal(executor.OutWriter, Console.Out);
}
[Fact]
public void Execute_Should_Throw_If_Package_Is_Null()
{
Expand Down

0 comments on commit 0344cc9

Please sign in to comment.