Skip to content

Commit 6012da7

Browse files
committed
cleanup
1 parent 2826f8f commit 6012da7

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

new-cli/Directory.Packages.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
</PropertyGroup>
55
<ItemGroup>
6-
76
<!-- common packages -->
87
<PackageVersion Include="LibGit2Sharp" Version="0.30.0" />
98
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
@@ -15,7 +14,6 @@
1514
<PackageVersion Include="Polly" Version="8.3.1" />
1615
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.0" />
1716
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.0" />
18-
1917
<!-- specific packages -->
2018
<PackageVersion Include="Scriban" Version="5.9.1" />
2119
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />

new-cli/docs/calculate.rsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
calculate -l c:\logs\log.txt --work-dir D:\Projects\OSS\GitTools\GitVersion --verbosity verbose
1+
calculate -l c:\logs\log.txt --work-dir C:\Projects\OSS\GitTools\GitVersion --verbosity verbose

src/GitVersion.Core/Helpers/PathHelper.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
using System.Runtime.InteropServices;
2+
13
namespace GitVersion.Helpers;
24

35
internal static class PathHelper
46
{
57
public static string NewLine => SysEnv.NewLine;
68

7-
private static readonly StringComparison OsDependentComparison = SysEnv.OSVersion.Platform switch
8-
{
9-
PlatformID.Unix or PlatformID.MacOSX => StringComparison.Ordinal,
10-
_ => StringComparison.OrdinalIgnoreCase,
11-
};
9+
private static readonly StringComparison OsDependentComparison =
10+
RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
11+
? StringComparison.Ordinal
12+
: StringComparison.OrdinalIgnoreCase;
1213

1314
public static string GetCurrentDirectory() => AppContext.BaseDirectory ?? throw new InvalidOperationException();
1415

src/GitVersion.Output/OutputGenerator/OutputGenerator.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ public void Execute(GitVersionVariables variables, OutputContext context)
3636
if (gitVersionOptions.Output.Contains(OutputType.File))
3737
{
3838
var retryOperation = new RetryAction<IOException>();
39-
retryOperation.Execute(() => this.fileSystem.WriteAllText(context.OutputFile, json));
39+
retryOperation.Execute(() =>
40+
{
41+
if (context.OutputFile != null) this.fileSystem.WriteAllText(context.OutputFile, json);
42+
});
4043
}
4144

4245
if (!gitVersionOptions.Output.Contains(OutputType.Json)) return;

0 commit comments

Comments
 (0)