Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<!-- Sets the verbosity for MinVer build output. Useful for debugging. -->
<MinVerDefaultPreReleaseIdentifiers>preview.0</MinVerDefaultPreReleaseIdentifiers>
<MinVerVerbosity>normal</MinVerVerbosity>
<Authors>henry-js</Authors>
<Company>henry-js</Company>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Authors>jamesshenry</Authors>
<Company>jamesshenry</Company>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MinVer" Version="6.0.0">
Expand Down
13 changes: 3 additions & 10 deletions src/DotNetPathUtils.Tests/PathEnvironmentHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ public async Task EnsureApplicationXdgConfigDirectoryIsInPath_Constructs_Correct
_service.IsWindows().Returns(false); // Simulate running on Linux

// Act
var result = _helper.EnsureApplicationXdgConfigDirectoryIsInPath(
null,
EnvironmentVariableTarget.User
);
var result = _helper.EnsureApplicationXdgConfigDirectoryIsInPath();

// Assert
await Assert.That(result.Status).IsEqualTo(PathUpdateStatus.PathAdded);
Expand Down Expand Up @@ -274,9 +271,7 @@ public async Task RemoveApplicationXdgConfigDirectoryFromPath_When_Path_Exists_R
.Returns(existingPath);

// Act
var result = _helper.RemoveApplicationXdgConfigDirectoryFromPath(
EnvironmentVariableTarget.User
);
var result = _helper.RemoveApplicationXdgConfigDirectoryFromPath();

// Assert
await Assert.That(result.Status).IsEqualTo(PathRemoveStatus.PathRemoved);
Expand All @@ -302,9 +297,7 @@ public async Task RemoveApplicationXdgConfigDirectoryFromPath_When_Path_Does_Not
.Returns(existingPath);

// Act
var result = _helper.RemoveApplicationXdgConfigDirectoryFromPath(
EnvironmentVariableTarget.User
);
var result = _helper.RemoveApplicationXdgConfigDirectoryFromPath();

// Assert
await Assert.That(result.Status).IsEqualTo(PathRemoveStatus.PathNotFound);
Expand Down
12 changes: 6 additions & 6 deletions src/DotNetPathUtils/PathEnvironmentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class PathEnvironmentHelper
private readonly ILogger<PathEnvironmentHelper>? _logger;

public PathEnvironmentHelper(
ILogger<PathEnvironmentHelper>? logger = null,
PathUtilsOptions? options = null
PathUtilsOptions? options = null,
ILogger<PathEnvironmentHelper>? logger = null
)
: this(new SystemEnvironmentService(), "PATH", options, logger) { }

Expand Down Expand Up @@ -41,8 +41,8 @@ internal PathEnvironmentHelper(

public PathModificationResult EnsureApplicationXdgConfigDirectoryIsInPath(
string? appName = null,
EnvironmentVariableTarget target = EnvironmentVariableTarget.User,
PathUtilsOptions? methodOptions = null // Renamed for clarity
PathUtilsOptions? methodOptions = null, // Renamed for clarity
EnvironmentVariableTarget target = EnvironmentVariableTarget.User
)
{
var effectiveOptions = methodOptions ?? _options;
Expand Down Expand Up @@ -157,9 +157,9 @@ .. currentPathVariable
}

public PathRemovalResult RemoveApplicationXdgConfigDirectoryFromPath(
EnvironmentVariableTarget target = EnvironmentVariableTarget.User,
string? appName = null,
PathUtilsOptions? methodOptions = null
PathUtilsOptions? methodOptions = null,
EnvironmentVariableTarget target = EnvironmentVariableTarget.User
)
{
var effectiveOptions = methodOptions ?? _options;
Expand Down