chezmoi: windows local appdata symlink
This commit is contained in:
parent
fedc7ce22b
commit
08358acd6e
@ -1,13 +1,23 @@
|
|||||||
{{- /* symlink into ~/.config on windows */ -}}
|
{{- /* symlink into ~/.config on windows */ -}}
|
||||||
|
|
||||||
{{- $confdirs := list "nvim" "alacritty" "nushell" -}}
|
{{- $roamingconfdirs := list "alacritty" "nushell" -}}
|
||||||
|
{{- $localconfdirs := list "nvim" -}}
|
||||||
|
|
||||||
{{- if eq .chezmoi.os "windows" -}}
|
{{- if eq .chezmoi.os "windows" -}}
|
||||||
$confdir = ([Environment]::GetFolderPath("ApplicationData"))
|
|
||||||
$userdir = ([Environment]::GetFolderPath("UserProfile"))
|
$userdir = ([Environment]::GetFolderPath("UserProfile"))
|
||||||
{{ range $confdirs }}
|
$roamingconfdir = ([Environment]::GetFolderPath("ApplicationData"))
|
||||||
If (-Not (Test-Path $confdir\{{ . }})) {
|
$localconfdir = ([Environment]::GetFolderPath("LocalApplicationData"))
|
||||||
New-Item -Path $confdir\{{ . }} -ItemType Junction -Value $userdir\.config\{{ . }}
|
|
||||||
|
{{ range $roamingconfdirs }}
|
||||||
|
If (-Not (Test-Path $roamingconfdir\{{ . }})) {
|
||||||
|
New-Item -Path $roamingconfdir\{{ . }} -ItemType Junction -Value $userdir\.config\{{ . }}
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ range $localconfdirs }}
|
||||||
|
If (-Not (Test-Path $localconfdir\{{ . }})) {
|
||||||
|
New-Item -Path $localconfdir\{{ . }} -ItemType Junction -Value $userdir\.config\{{ . }}
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
Loading…
Reference in New Issue
Block a user