From fedc7ce22bcae9c16ecdb1f86dcc4aa0bccd1e13 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Wed, 14 Aug 2024 22:49:22 -0400 Subject: [PATCH] chezmoi: windows symlink for config --- src/run_after__symlink-config_windows.ps1.tmpl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/run_after__symlink-config_windows.ps1.tmpl 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..81da457 --- /dev/null +++ b/src/run_after__symlink-config_windows.ps1.tmpl @@ -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 -}}