Skip to content

Commit 1b5f161

Browse files
authored
Merge pull request #729 from dotnet/v3.4
Merge v3.4 to master
2 parents e590f87 + ba46f06 commit 1b5f161

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
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

src/Nerdbank.GitVersioning.Tasks/ContextAwareTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ where outerProperty.SetMethod is not null && outerProperty.GetMethod is not null
5656
// On .NET Framework (on Windows), we find native binaries by adding them to our PATH.
5757
if (this.UnmanagedDllDirectory is not null)
5858
{
59-
string pathEnvVar = Environment.GetEnvironmentVariable("PATH");
59+
string pathEnvVar = Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
6060
string[] searchPaths = pathEnvVar.Split(Path.PathSeparator);
6161
if (!searchPaths.Contains(this.UnmanagedDllDirectory, StringComparer.OrdinalIgnoreCase))
6262
{

src/Shared/Utilities.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal static void FileOperationWithRetry(Action operation)
1919
try
2020
{
2121
operation();
22+
break;
2223
}
2324
catch (IOException ex) when (ex.HResult == ProcessCannotAccessFileHR && retriesLeft > 0)
2425
{

0 commit comments

Comments
 (0)