Skip to content

Commit

Permalink
build without cliwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
taori committed Aug 17, 2024
1 parent 8590507 commit 359c2c9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/Amusoft.DotnetNew.Tests/CLI/DotnetNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,37 @@ public static async Task BuildAsync(string fullPath, string? arguments, Verbosit
CreateNoWindow = true,
};

psi.Environment.Add("DOTNET_CLI_UI_LANGUAGE","en");

var process = new Process();
process.StartInfo = psi;
process.Start();

if (process.WaitForExit(30000))
{
loggingScope.ParentScope?.AddResult(new TextResult($"success: {fullArgs}"));;
if (process.ExitCode == 0)
{
loggingScope.ParentScope?.AddResult(new TextResult($"success: {fullArgs}"));;
}
else
{
throw new BuildFailedException(fullArgs, loggingScope.ToFullString(PrintKind.All));
}
}
else
{
process.Kill();
throw new BuildFailedException(fullArgs, loggingScope.ToFullString(PrintKind.All));
}

// if (await LoggedDotnetCli.RunDotnetCommandAsync(fullArgs, cancellationToken, []))
// {
// loggingScope.ParentScope?.AddResult(new TextResult($"success: {fullArgs}"));
// }
// else
// {
// throw new BuildFailedException(fullArgs, loggingScope.ToFullString(PrintKind.All));
// }
if (await LoggedDotnetCli.RunDotnetCommandAsync(fullArgs, cancellationToken, []))
{
loggingScope.ParentScope?.AddResult(new TextResult($"success: {fullArgs}"));
}
else
{
throw new BuildFailedException(fullArgs, loggingScope.ToFullString(PrintKind.All));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ private async Task ScaffoldRepo(string projectName, string gitUser, string autho
await scaffold.RestoreAsync($"src/{projectName}.sln", null, CancellationToken.None);
await scaffold.BuildAsync($"src/{projectName}.sln", null, CancellationToken.None);

var a = loggingScope.ToFullString(PrintKind.All);

await Verifier.Verify(new
{
log = loggingScope.ToFullString(PrintKind.All),
Expand Down

0 comments on commit 359c2c9

Please sign in to comment.