Skip to content

Commit

Permalink
Build: Log more information when GitVersion fails
Browse files Browse the repository at this point in the history
  • Loading branch information
aaubry committed Mar 30, 2021
1 parent cb0768c commit b5b84c9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tools/build/BuildDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ public static class BuildDefinition
{
public static GitVersion ResolveVersion(Options options, PreviousReleases releases)
{
var versionJson = Read("dotnet", $"gitversion /nofetch{(options.Verbose ? " /diag" : "")}", BasePath);
string versionJson;
try
{
versionJson = Read("dotnet", $"gitversion /nofetch{(options.Verbose ? " /diag" : "")}", BasePath);
}
catch (NonZeroExitCodeException)
{
Run("dotnet", "gitversion /nofetch /diag", BasePath);
throw;
}

WriteVerbose(versionJson);

if (options.Verbose)
Expand Down Expand Up @@ -226,7 +236,7 @@ public static ScaffoldedRelease ScaffoldReleaseNotes(GitVersion version, Previou
.Select(c => string.Join(" \n", c));

var releaseNotes = string.Join("\n\n", log);

WriteVerbose(releaseNotes);

return new ScaffoldedRelease(releaseNotes);
Expand Down

0 comments on commit b5b84c9

Please sign in to comment.