Skip to content

Commit

Permalink
chore: update package dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezanet committed Dec 6, 2024
1 parent 6038de4 commit 0d859b1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/Husky/Cli/AttachCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private string GetInstallCommand()
private async Task<string> GetRelativePath(string filepath)
{
var gitPath = await _git.GetGitPathAsync();
var fileInfo = _io.FileInfo.FromFileName(filepath);
var fileInfo = _io.FileInfo.New(filepath);
var relativePath = Path.GetRelativePath(fileInfo.DirectoryName!, gitPath);
return relativePath;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Husky/Cli/ExecCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ internal async ValueTask ExecuteScript(string scriptPath)
internal async Task<(bool, string)> GetCachedScript(string scriptPath)
{
var cacheFolder = await GetHuskyCacheFolder();
await using var fileStream = _fileSystem.FileStream.Create(scriptPath, FileMode.Open);
await using var fileStream = _fileSystem.FileStream.New(scriptPath, FileMode.Open);

var hash = await CalculateHashAsync(fileStream);

Expand Down
2 changes: 1 addition & 1 deletion src/Husky/Cli/InstallCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private async Task ConfigureGitAndFilePermission(string path, string husky_shPat
$"Configuring Git and File permissions in '{husky_shPath}'".LogVerbose();

// find all hooks (if exists) from .husky/ and add executable flag
var files = _fileSystem.Directory.GetFiles(path).Where(f => !_fileSystem.FileInfo.FromFileName(f).Name.Contains('.')).ToList();
var files = _fileSystem.Directory.GetFiles(path).Where(f => !_fileSystem.FileInfo.New(f).Name.Contains('.')).ToList();
files.Add(husky_shPath);
await _cliWrap.SetExecutablePermission(files.ToArray());

Expand Down
15 changes: 7 additions & 8 deletions src/Husky/Husky.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CliFx" Version="2.3.5" />
<PackageReference Include="CliWrap" Version="3.6.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.8.0-3.final" />

<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0" />
<PackageReference Include="System.IO.Abstractions" Version="19.2.87" />
<PackageReference Include="CliWrap" Version="3.6.7" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.12.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="9.0.0" />
<PackageReference Include="System.IO.Abstractions" Version="21.1.7" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Utils\Dotnet\ParallelRangeManager.cs" />
Expand Down
16 changes: 9 additions & 7 deletions tests/HuskyIntegrationTests/HuskyIntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@

<ItemGroup>
<PackageReference Include="Docker.DotNet" Version="3.125.15" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Meziantou.Xunit.ParallelTestFramework" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="Testcontainers" Version="3.6.0" />
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="Meziantou.Xunit.ParallelTestFramework" Version="2.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="System.IO.Abstractions" Version="21.1.7" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.1.7" />
<PackageReference Include="Testcontainers" Version="4.0.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions tests/HuskyTest/Cli/AttachCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public AttachCommandTests()
_git.GetGitPathAsync().Returns(_currentDirectory); // usually same as current directory but can be different
_io = Substitute.For<IFileSystem>();
var fileInfoWrapper = new FileInfoWrapper(_io, new FileInfo(Path.Combine(_currentDirectory, _fileName)));
_io.FileInfo.FromFileName(Arg.Any<string>()).Returns(fileInfoWrapper);
_io.FileInfo.New(Arg.Any<string>()).Returns(fileInfoWrapper);
_io.Directory.GetCurrentDirectory().Returns(_currentDirectory);
const string _csprojXml =
"<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><TargetFramework>netcoreapp2.1</TargetFramework></PropertyGroup></Project>";
Expand Down Expand Up @@ -155,7 +155,7 @@ public async Task Attach_WorkingDirectoryShouldBeRelativePathToProjectRoot(strin
_currentDirectory = currentDirectory;
_fileName = fileName;
var fileInfoWrapper = new FileInfoWrapper(_io, new FileInfo(Path.Combine(_currentDirectory, _fileName)));
_io.FileInfo.FromFileName(Arg.Any<string>()).Returns(fileInfoWrapper);
_io.FileInfo.New(Arg.Any<string>()).Returns(fileInfoWrapper);
var command = new AttachCommand(_git, _io, _xmlIo) { FileName = _fileName };

// Act
Expand Down
13 changes: 7 additions & 6 deletions tests/HuskyTest/HuskyTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.1.7" />
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down

0 comments on commit 0d859b1

Please sign in to comment.