Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert DirectoryExtensions methods to extensions #40

Merged
merged 1 commit into from
Mar 28, 2024
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
2 changes: 1 addition & 1 deletion Sources/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PropertyGroup>
<RepositoryUrl>https://github.com/kysect/Kysect.CommonLib</RepositoryUrl>
<PackageProjectUrl>https://github.com/kysect/Kysect.CommonLib</PackageProjectUrl>
<Version>0.1.19</Version>
<Version>0.1.20</Version>
</PropertyGroup>

<!-- Code configuration -->
Expand Down
8 changes: 4 additions & 4 deletions Sources/Kysect.CommonLib/FileSystem/DirectoryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Kysect.CommonLib.FileSystem;

public static class DirectoryExtensions
{
public static void EnsureParentDirectoryExists(IFileSystem fileSystem, string path)
public static void EnsureParentDirectoryExists(this IFileSystem fileSystem, string path)
{
fileSystem.ThrowIfNull();
path.ThrowIfNull();
Expand All @@ -14,7 +14,7 @@ public static void EnsureParentDirectoryExists(IFileSystem fileSystem, string pa
EnsureParentDirectoryExists(fileSystem, fileInfo);
}

public static void EnsureParentDirectoryExists(IFileSystem fileSystem, IFileInfo file)
public static void EnsureParentDirectoryExists(this IFileSystem fileSystem, IFileInfo file)
{
fileSystem.ThrowIfNull();
file.ThrowIfNull();
Expand All @@ -25,15 +25,15 @@ public static void EnsureParentDirectoryExists(IFileSystem fileSystem, IFileInfo
EnsureDirectoryExists(fileSystem, file.Directory);
}

public static void EnsureDirectoryExists(IFileSystem fileSystem, IDirectoryInfo directory)
public static void EnsureDirectoryExists(this IFileSystem fileSystem, IDirectoryInfo directory)
{
fileSystem.ThrowIfNull();
directory.ThrowIfNull();

EnsureDirectoryExists(fileSystem, directory.FullName);
}

public static void EnsureDirectoryExists(IFileSystem fileSystem, string path)
public static void EnsureDirectoryExists(this IFileSystem fileSystem, string path)
{
fileSystem.ThrowIfNull();
path.ThrowIfNull();
Expand Down
Loading