Skip to content

Commit

Permalink
Fixing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
credfeto committed Jan 26, 2024
1 parent cf880c4 commit 458466d
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@ private async ValueTask<Difference> IsSameContentAsync(string sourceFileName, st
byte[] sourceBytes = await File.ReadAllBytesAsync(path: sourceFileName, cancellationToken: cancellationToken);
(sourceBytes, bool changed) = applyChanges(sourceBytes);

if (changed)
{
this._logger.LogInformation($"Transform on {sourceFileName} resulted in changes");
}

if (!File.Exists(targetFileName))
{
this._logger.LogDebug($"{targetFileName} is missing");
Expand All @@ -649,12 +654,9 @@ private async ValueTask<Difference> IsSameContentAsync(string sourceFileName, st
return Difference.SAME;
}

this._logger.LogDebug($"{targetFileName} is different");
this._logger.LogInformation($"{targetFileName} is different");

if (changed)
{
await File.WriteAllBytesAsync(path: targetFileName, bytes: sourceBytes, cancellationToken: cancellationToken);
}
await File.WriteAllBytesAsync(path: targetFileName, bytes: sourceBytes, cancellationToken: cancellationToken);

return Difference.DIFFERENT;
}
Expand Down

0 comments on commit 458466d

Please sign in to comment.