Skip to content

Commit

Permalink
feat: log task-runner.json loading path
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezanet committed Jun 8, 2023
1 parent 433a6f9 commit a4a7fdd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/.vuepress/configs/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version: string = '0.5.2'
export const version: string = '0.6.0-Preview4'
2 changes: 1 addition & 1 deletion src/Husky/Husky.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<PackageId>Husky</PackageId>
<Version>0.6.0-Preview2</Version>
<Version>0.6.0-Preview4</Version>
<Title>Husky</Title>
<Authors>AliReza Sabouri</Authors>
<Description>Git hooks made easy, woof!</Description>
Expand Down
10 changes: 6 additions & 4 deletions src/Husky/TaskRunner/HuskyTaskLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text.RegularExpressions;
using CliFx.Exceptions;
using Husky.Services.Contracts;
using Husky.Stdout;
using Microsoft.Extensions.Configuration;

namespace Husky.TaskRunner;
Expand All @@ -28,12 +29,12 @@ public HuskyTaskLoader(IGit git)

public async Task LoadAsync()
{
var gitPath = await _git.GetGitPathAsync();
var huskyPath = await _git.GetHuskyPathAsync();
Tasks = new List<HuskyTask>();
var dir = Path.Combine(gitPath, huskyPath, "task-runner.json");
try
{
var gitPath = await _git.GetGitPathAsync();
var huskyPath = await _git.GetHuskyPathAsync();
Tasks = new List<HuskyTask>();
var dir = Path.Combine(gitPath, huskyPath, "task-runner.json");
var config = new ConfigurationBuilder()
.AddJsonFile(dir)
.Build();
Expand All @@ -42,6 +43,7 @@ public async Task LoadAsync()
}
catch (FileNotFoundException e)
{
$"task-runner.json path: '{dir}'".LogVerbose();
throw new CommandException("Can not find task-runner.json, try 'husky install'", innerException: e);
}
}
Expand Down

0 comments on commit a4a7fdd

Please sign in to comment.