Skip to content

Commit b6e44c3

Browse files
Hugo-Dahl-TylerAArnott
authored andcommitted
Use 'File.AppendLine()' to generate output
Let the 'System.IO.File' provider handle newlines between entries rather than manually inserting them Addresses item 2 of #726
1 parent 4d9c33d commit b6e44c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/NerdBank.GitVersioning/CloudBuildServices/GitHubActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public IReadOnlyDictionary<string, string> SetCloudBuildNumber(string buildNumbe
2828

2929
public IReadOnlyDictionary<string, string> SetCloudBuildVariable(string name, string value, TextWriter stdout, TextWriter stderr)
3030
{
31-
Utilities.FileOperationWithRetry(() => File.AppendAllText(EnvironmentFile, $"{Environment.NewLine}{name}={value}{Environment.NewLine}"));
31+
Utilities.FileOperationWithRetry(() => File.AppendAllLines(EnvironmentFile, new [] {$"{name}={value}"}));
3232
return GetDictionaryFor(name, value);
3333
}
3434

0 commit comments

Comments
 (0)