chezmoi: windows symlink for config
This commit is contained in:
parent
72e4a9f3c7
commit
73aa4f5f23
30
src/run_after__symlink-config_windows.ps1.tmpl
Normal file
30
src/run_after__symlink-config_windows.ps1.tmpl
Normal file
@ -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 -}}
|
Loading…
Reference in New Issue
Block a user