Skip to content

Commit 050847b

Browse files
author
Oren Novotny
committed
Add trim to counter newlines
1 parent aa4608d commit 050847b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitVersionTask/AssemblyInfoBuilder/UpdateAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ void CreateTempAssemblyInfo(VersionVariables versionVariables)
9595
}
9696

9797
var assemblyInfoBuilder = new AssemblyInfoBuilder();
98-
var assemblyInfo = assemblyInfoBuilder.GetAssemblyInfoText(versionVariables, RootNamespace);
98+
var assemblyInfo = assemblyInfoBuilder.GetAssemblyInfoText(versionVariables, RootNamespace).Trim();
9999

100100
// We need to try to read the existing text first if the file exists and see if it's the same
101101
// This is to avoid writing when there's no differences and causing a rebuild
102102
try
103103
{
104104
if (File.Exists(AssemblyInfoTempFilePath))
105105
{
106-
var content = File.ReadAllText(AssemblyInfoTempFilePath, Encoding.UTF8);
106+
var content = File.ReadAllText(AssemblyInfoTempFilePath, Encoding.UTF8).Trim();
107107
if (string.Equals(assemblyInfo, content, StringComparison.Ordinal))
108108
return; // nothign to do as the file matches what we'd create
109109
}

0 commit comments

Comments
 (0)