Skip to content

Commit 0bd288c

Browse files
committed
Bootstrap husky
1 parent 62a9961 commit 0bd288c

File tree

4 files changed

+52
-6
lines changed

4 files changed

+52
-6
lines changed

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"husky": {
6+
"version": "0.7.1",
7+
"commands": [
8+
"husky"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.husky/pre-commit

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
## husky task runner examples -------------------
5+
## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky'
6+
7+
## run all tasks
8+
#husky run
9+
10+
### run all tasks with group: 'group-name'
11+
#husky run --group group-name
12+
13+
## run task with name: 'task-name'
14+
#husky run --name task-name
15+
16+
## pass hook arguments to task
17+
#husky run --args "$1" "$2"
18+
19+
## or put your custom commands -------------------
20+
#echo 'Husky.Net is awesome!'
21+
22+
dotnet husky run

.husky/task-runner.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://alirezanet.github.io/Husky.Net/schema.json",
3+
"tasks": [
4+
{
5+
"name": "Run csharpier",
6+
"command": "dotnet",
7+
"args": [ "csharpier", "${staged}" ],
8+
"include": [ "**/*.cs" ]
9+
}
10+
]
11+
}

build/_build.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
1+
<Project Sdk="Microsoft.NET.Sdk">
32
<PropertyGroup>
43
<OutputType>Exe</OutputType>
54
<TargetFramework>net8.0</TargetFramework>
@@ -9,14 +8,15 @@
98
<NukeScriptDirectory>..</NukeScriptDirectory>
109
<NukeTelemetryVersion>1</NukeTelemetryVersion>
1110
</PropertyGroup>
12-
1311
<ItemGroup>
1412
<PackageReference Include="Nuke.Common" Version="8.1.1" />
1513
</ItemGroup>
16-
1714
<ItemGroup>
1815
<PackageDownload Include="GitVersion.CommandLine" Version="[5.12.0]" />
1916
<PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" />
2017
</ItemGroup>
21-
22-
</Project>
18+
<Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0">
19+
<Exec Command="dotnet tool restore" StandardOutputImportance="Low" StandardErrorImportance="High" />
20+
<Exec Command="dotnet husky install" StandardOutputImportance="Low" StandardErrorImportance="High" WorkingDirectory=".." />
21+
</Target>
22+
</Project>

0 commit comments

Comments
 (0)