Skip to content

Commit 7026f24

Browse files
committed
fix: Make gitignore work without tests dir
1 parent 402323e commit 7026f24

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

templates/.gitignore.tpl

+2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ tempchangelog.md
4545
tests/*
4646
!tests/README.md
4747

48+
{{ if stencil.Exists "tests" -}}
4849
{{ range $entry := stencil.ReadDir "tests" -}}
4950
{{ if $entry.IsDir -}}
5051
!tests/{{ $entry.Name }}
5152
tests/{{ $entry.Name }}/*
5253
!tests/{{ $entry.Name }}/stencil.yaml
5354
{{ end -}}
5455
{{- end }}
56+
{{- end }}
5557
## <<Stencil::Block(ignores)>>
5658
{{ file.Block "ignores" }}
5759
## <</Stencil::Block>>

0 commit comments

Comments
 (0)