Skip to content

Commit

Permalink
Use cliwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
meziantou committed Feb 23, 2024
1 parent 09b626f commit 24cd77a
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions tests/Workleap.DotNet.CodingStandards.Tests/PackageFixture.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Diagnostics;
using CliWrap;
using CliWrap.Buffered;
using Workleap.DotNet.CodingStandards.Tests.Helpers;

namespace Workleap.DotNet.CodingStandards.Tests;
Expand All @@ -26,19 +26,9 @@ public async Task InitializeAsync()
}
else
{
// CliWrap doesn't support UseShellExecute. On Linux, it's easier to use it as "nuget" is a shell script that use mono to run nuget.exe
var psi = new ProcessStartInfo("nuget");
foreach (var arg in args)
{
psi.ArgumentList.Add(arg);
}

var p = Process.Start(psi)!;
await p.WaitForExitAsync();
if (p.ExitCode != 0)
{
throw new InvalidOperationException("Error when running creating the NuGet package");
}
_ = await Cli.Wrap("nuget")
.WithArguments(args)
.ExecuteBufferedAsync();
}
}

Expand Down

0 comments on commit 24cd77a

Please sign in to comment.