Skip to content

Commit

Permalink
Additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
credfeto committed Nov 26, 2020
1 parent fff6c98 commit 535542f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Credfeto.ChangeLog.Cmd/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ private static async Task<int> Main(string[] args)
}
}

Console.WriteLine($"Using Changelog {changeLog}");

string extractFileName = configuration.GetValue<string>("extract");

if (!string.IsNullOrEmpty(extractFileName))
{
string version = configuration.GetValue<string>("version");

Console.WriteLine($"Version: {version}");

string text = await ChangeLogReader.ExtractReleaseNodesFromFileAsync(changeLogFileName: changeLog, version: version);

await File.WriteAllTextAsync(path: extractFileName, contents: text, encoding: Encoding.UTF8);
Expand All @@ -59,6 +63,9 @@ private static async Task<int> Main(string[] args)
return ERROR;
}

Console.WriteLine($"Change Type: {addType}");
Console.WriteLine($"Message: {message}");

await ChangeLogUpdater.AddEntryAsync(changeLogFileName: changeLog, type: addType, message: message);

return SUCCESS;
Expand All @@ -68,6 +75,7 @@ private static async Task<int> Main(string[] args)

if (!string.IsNullOrWhiteSpace(branchName))
{
Console.WriteLine($"Branch: {branchName}");
bool valid = await ChangeLogChecker.ChangeLogModifiedInReleaseSectionAsync(changeLogFileName: changeLog, originBranchName: branchName);

if (valid)
Expand All @@ -86,6 +94,8 @@ private static async Task<int> Main(string[] args)

if (!string.IsNullOrWhiteSpace(releaseVersion))
{
Console.WriteLine($"Release Version: {releaseVersion}");

await ChangeLogUpdater.CreateReleaseAsync(changeLogFileName: changeLog, version: releaseVersion);

return SUCCESS;
Expand Down
1 change: 0 additions & 1 deletion src/Credfeto.ChangeLog/ChangeLogChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public static class ChangeLogChecker
public static async Task<bool> ChangeLogModifiedInReleaseSectionAsync(string changeLogFileName, string originBranchName)
{
changeLogFileName = GetFullChangeLogFilePath(changeLogFileName);
Console.WriteLine($"Changelog: {changeLogFileName}");
int? position = await ChangeLogReader.FindFirstReleaseVersionPositionAsync(changeLogFileName);

if (position == null)
Expand Down

0 comments on commit 535542f

Please sign in to comment.