From 068080573837424503ee651def908f79600b0981 Mon Sep 17 00:00:00 2001 From: Lucas Lara Date: Tue, 4 Apr 2023 22:36:15 +0200 Subject: [PATCH] Fix warnings --- minicover.sh | 2 +- src/MiniCover/CommandLine/Commands/InstrumentCommand.cs | 2 +- src/MiniCover/CommandLine/DirectoryOption.cs | 2 +- src/MiniCover/CommandLine/FileOption.cs | 2 +- src/MiniCover/CommandLine/Options/WorkingDirectoryOption.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/minicover.sh b/minicover.sh index 966f8ad..7bdb860 100755 --- a/minicover.sh +++ b/minicover.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -dotnet run -p src/MiniCover/MiniCover.csproj -f net7.0 -- "$@" \ No newline at end of file +dotnet run --project src/MiniCover/MiniCover.csproj -f net7.0 -- "$@" \ No newline at end of file diff --git a/src/MiniCover/CommandLine/Commands/InstrumentCommand.cs b/src/MiniCover/CommandLine/Commands/InstrumentCommand.cs index 8b247a6..dd1c924 100644 --- a/src/MiniCover/CommandLine/Commands/InstrumentCommand.cs +++ b/src/MiniCover/CommandLine/Commands/InstrumentCommand.cs @@ -125,7 +125,7 @@ private static IFileInfo[] GetFiles( var fileMatchResult = matcher.Execute(new Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper(new DirectoryInfo(parentDir.FullName))); return fileMatchResult.Files - .Select(f => parentDir.FileSystem.FileInfo.FromFileName(Path.GetFullPath(Path.Combine(parentDir.ToString(), f.Path)))) + .Select(f => parentDir.FileSystem.FileInfo.New(Path.GetFullPath(Path.Combine(parentDir.ToString(), f.Path)))) .ToArray(); } diff --git a/src/MiniCover/CommandLine/DirectoryOption.cs b/src/MiniCover/CommandLine/DirectoryOption.cs index 025c7ba..99013b4 100644 --- a/src/MiniCover/CommandLine/DirectoryOption.cs +++ b/src/MiniCover/CommandLine/DirectoryOption.cs @@ -18,7 +18,7 @@ protected DirectoryOption(IFileSystem fileSystem) public virtual void ReceiveValue(string value) { - DirectoryInfo = _fileSystem.DirectoryInfo.FromDirectoryName(value ?? DefaultValue); + DirectoryInfo = _fileSystem.DirectoryInfo.New(value ?? DefaultValue); } } } \ No newline at end of file diff --git a/src/MiniCover/CommandLine/FileOption.cs b/src/MiniCover/CommandLine/FileOption.cs index 8238793..03707eb 100644 --- a/src/MiniCover/CommandLine/FileOption.cs +++ b/src/MiniCover/CommandLine/FileOption.cs @@ -18,7 +18,7 @@ protected FileOption(IFileSystem fileSystem) public virtual void ReceiveValue(string value) { - FileInfo = _fileSystem.FileInfo.FromFileName(value ?? DefaultValue); + FileInfo = _fileSystem.FileInfo.New(value ?? DefaultValue); } } } \ No newline at end of file diff --git a/src/MiniCover/CommandLine/Options/WorkingDirectoryOption.cs b/src/MiniCover/CommandLine/Options/WorkingDirectoryOption.cs index d7bf5f0..648104b 100644 --- a/src/MiniCover/CommandLine/Options/WorkingDirectoryOption.cs +++ b/src/MiniCover/CommandLine/Options/WorkingDirectoryOption.cs @@ -25,7 +25,7 @@ public override void ReceiveValue(string value) { base.ReceiveValue(value); - var currentDirectory = _fileSystem.DirectoryInfo.FromDirectoryName(_fileSystem.Directory.GetCurrentDirectory()); + var currentDirectory = _fileSystem.DirectoryInfo.New(_fileSystem.Directory.GetCurrentDirectory()); if (DirectoryInfo.FullName != currentDirectory.FullName) { DirectoryInfo.Create();