chezmoi: windows symlink for config

This commit is contained in:
dogeystamp 2024-08-14 22:49:22 -04:00
parent 72e4a9f3c7
commit fedc7ce22b
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -0,0 +1,13 @@
{{- /* symlink into ~/.config on windows */ -}}
{{- $confdirs := list "nvim" "alacritty" "nushell" -}}
{{- if eq .chezmoi.os "windows" -}}
$confdir = ([Environment]::GetFolderPath("ApplicationData"))
$userdir = ([Environment]::GetFolderPath("UserProfile"))
{{ range $confdirs }}
If (-Not (Test-Path $confdir\{{ . }})) {
New-Item -Path $confdir\{{ . }} -ItemType Junction -Value $userdir\.config\{{ . }}
}
{{ end }}
{{- end -}}