1
0

Import .gitconfig automatically if in ~/Projects

This commit is contained in:
2025-10-12 15:25:38 +02:00
parent 2ae78ecfaf
commit 8730ff086a

View File

@@ -17,3 +17,14 @@ ff = true
[credential] [credential]
helper = {{ $credentialHelperPath }} helper = {{ $credentialHelperPath }}
{{- end }} {{- end }}
{{- $projectsDir := joinPath .chezmoi.homeDir "Projects" }}
{{- if stat $projectsDir }}
{{- $projects := output "find" $projectsDir "-type" "f" "-mindepth" "2" "-maxdepth" "2" "-name" ".gitconfig" | trim | splitList "\n" }}
{{- range $projects }}
{{- if . }}
[includeIf "gitdir:{{ . | dir }}/**/"]
path = {{ . }}
{{- end }}
{{- end }}
{{- end }}