Skip to content

Commit

Permalink
Use 'File.AppendLine()' to generate output
Browse files Browse the repository at this point in the history
Let the 'System.IO.File' provider handle newlines between entries rather than manually inserting them
Addresses item 2 of dotnet#726
  • Loading branch information
Hugo-Dahl-Tyler authored and akobr committed Mar 18, 2022
1 parent 2af44fc commit 6a36b36
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -28,7 +28,7 @@ internal class GitHubActions : ICloudBuild

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

Expand Down

0 comments on commit 6a36b36

Please sign in to comment.