Skip to content

Commit

Permalink
Merge branch 'hotfix/0.6.2'
Browse files Browse the repository at this point in the history
* hotfix/0.6.2:
  (maint) Fix string formatting
  (#45) Make it clear when are error has happened
  • Loading branch information
gep13 committed May 3, 2022
2 parents a964e17 + c6e5d63 commit 0f63b7b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Chocolatey.Cake.Recipe/Content/gitversion.cake
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public class BuildVersion
prerelease,
prerelease == "alpha" || prerelease == "beta" ? buildDate : string.Empty,
BuildParameters.BuildCounter != "-1" ? string.Format("-{0}", BuildParameters.BuildCounter) : string.Empty);
informationalVersion = string.Format("{0}-{1}-{2}-{3}", majorMinorPatch, prerelease, buildDate, sha);
informationalVersion = string.Format("{0}-{1}{2}-{3}", majorMinorPatch, prerelease, buildDate, sha);
context.Information("There is no tag.");
}
else
Expand Down
22 changes: 22 additions & 0 deletions Chocolatey.Cake.Recipe/Content/localbuild.cake
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public class LocalBuildRepositoryInfo : IRepositoryInfo
}
else
{
context.Information("What version of git are we using...");
context.StartProcess("git", new ProcessSettings { Arguments = "--version" });

context.Information("Getting current branch name...");
IEnumerable<string> redirectedStandardOutput;
IEnumerable<string> redirectedError;
Expand All @@ -101,6 +104,25 @@ public class LocalBuildRepositoryInfo : IRepositoryInfo
context.Information("Branch name is {0}", Branch);
}
}
else
{
context.Error("Unable to find branch name!");
context.Information("Writing out standard out...");
var standardOutLines = redirectedStandardOutput.ToList();
foreach (var standardOutLine in standardOutLines)
{
context.Information(standardOutLine);
}

context.Information("Writing out standard error...");
var standardErrorLines = redirectedError.ToList();
foreach (var standardErrorLine in standardErrorLines)
{
context.Information(standardErrorLine);
}

Branch = "unknown";
}

Name = "Local";
Tag = new LocalBuildTagInfo(context);
Expand Down

0 comments on commit 0f63b7b

Please sign in to comment.