diff --git a/src/run_after__symlink-config_windows.ps1.tmpl b/src/run_after__symlink-config_windows.ps1.tmpl new file mode 100644 index 0000000..e1180fc --- /dev/null +++ b/src/run_after__symlink-config_windows.ps1.tmpl @@ -0,0 +1,30 @@ +{{- /* symlink into ~/.config and ~/.local/share/ on windows */ -}} + +{{- $roamingconfdirs := list "alacritty" "nushell" -}} +{{- $localconfdirs := list "nvim" -}} +{{- $localdatadirs := list "nvim-data/site" -}} + +{{- if eq .chezmoi.os "windows" -}} +$userdir = ([Environment]::GetFolderPath("UserProfile")) +$roamingconfdir = ([Environment]::GetFolderPath("ApplicationData")) +$localconfdir = ([Environment]::GetFolderPath("LocalApplicationData")) + +{{ range $roamingconfdirs }} +If (-Not (Test-Path $roamingconfdir\{{ . }})) { + New-Item -Path $roamingconfdir\{{ . }} -ItemType Junction -Value $userdir\.config\{{ . }} +} +{{ end }} + +{{ range $localconfdirs }} +If (-Not (Test-Path $localconfdir\{{ . }})) { + New-Item -Path $localconfdir\{{ . }} -ItemType Junction -Value $userdir\.config\{{ . }} +} +{{ end }} + +{{ range $localdatadirs }} +If (-Not (Test-Path $localconfdir\{{ . }})) { + New-Item -Path $localconfdir\{{ . }} -ItemType Junction -Value $userdir\.local\share\{{ . }} +} +{{ end }} + +{{- end -}}