From 047ebd2dd934aee9636336def8b7df1c2e153c94 Mon Sep 17 00:00:00 2001 From: deler Date: Mon, 12 Aug 2024 23:34:05 +0200 Subject: [PATCH] fix hidden path issue --- src/Husky/TaskRunner/HuskyTaskLoader.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Husky/TaskRunner/HuskyTaskLoader.cs b/src/Husky/TaskRunner/HuskyTaskLoader.cs index d1b25c0..f82e5d4 100644 --- a/src/Husky/TaskRunner/HuskyTaskLoader.cs +++ b/src/Husky/TaskRunner/HuskyTaskLoader.cs @@ -4,6 +4,8 @@ using Husky.Services.Contracts; using Husky.Stdout; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.FileProviders; +using Microsoft.Extensions.FileProviders.Physical; namespace Husky.TaskRunner; @@ -32,11 +34,12 @@ public async Task LoadAsync() var gitPath = await _git.GetGitPathAsync(); var huskyPath = await _git.GetHuskyPathAsync(); Tasks = new List(); - var dir = Path.Combine(gitPath, huskyPath, "task-runner.json"); + var dir = Path.Combine(gitPath, huskyPath); try { var config = new ConfigurationBuilder() - .AddJsonFile(dir) + .SetFileProvider(new PhysicalFileProvider(dir, ExclusionFilters.None)) + .AddJsonFile("task-runner.json") .Build(); config.GetSection("tasks").Bind(Tasks); OverrideWindowsSpecifics();