aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2026-07-23 10:20:06 +0200
committerThomas Schmucker <ts@its1.de>2026-07-23 10:20:06 +0200
commitc196e9a59a47bcaceab93342af5cf7a2f6ddd853 (patch)
tree79d23bf9cf9f95811f07d951a5e6ca6ae31e9af7
parentbb70769ffdc3b93329f364f47c49148658a03d44 (diff)
downloaddotfiles-c196e9a59a47bcaceab93342af5cf7a2f6ddd853.tar.gz
dotfiles-c196e9a59a47bcaceab93342af5cf7a2f6ddd853.tar.bz2
dotfiles-c196e9a59a47bcaceab93342af5cf7a2f6ddd853.zip
windows: manuelle Schritte reduzieren (PATH-Refresh, windows/bin automatisch im PATH)
bootstrap/neovim-win.ps1: Update-SessionPath liest PATH nach der Git/Node-Installation aus der Registry neu ein, damit die folgenden npm-Installationen (Formatters/LSP) im selben Lauf nicht faelschlich 'npm nicht gefunden' melden. install-win.ps1: haengt windows/bin (gmake.cmd) automatisch und idempotent an den User-PATH an, statt das manuell per Anleitung zu verlangen.
-rw-r--r--bootstrap/neovim-win.ps112
-rw-r--r--install-win.ps117
2 files changed, 29 insertions, 0 deletions
diff --git a/bootstrap/neovim-win.ps1 b/bootstrap/neovim-win.ps1
index a2e755b..1ea3b3c 100644
--- a/bootstrap/neovim-win.ps1
+++ b/bootstrap/neovim-win.ps1
@@ -89,9 +89,21 @@ function Test-Prerequisites {
89 } 89 }
90} 90}
91 91
92function Update-SessionPath {
93 # winget/npm-Installer tragen PATH-Aenderungen in die Registry (User-
94 # und/oder Machine-Scope) ein, aber der laufende PowerShell-Prozess
95 # bekommt das nicht automatisch mit. Ohne diesen Refresh wuerde z.B.
96 # "npm" gleich im Anschluss an die Node-Installation als "nicht
97 # gefunden" gemeldet, obwohl es gerade erst installiert wurde.
98 $machine = [Environment]::GetEnvironmentVariable("PATH", "Machine")
99 $user = [Environment]::GetEnvironmentVariable("PATH", "User")
100 $env:PATH = "$machine;$user"
101}
102
92function Install-Prerequisites { 103function Install-Prerequisites {
93 Install-WingetPackage -Binary "git" -Id "Git.Git" 104 Install-WingetPackage -Binary "git" -Id "Git.Git"
94 Install-WingetPackage -Binary "node" -Id "OpenJS.NodeJS.LTS" 105 Install-WingetPackage -Binary "node" -Id "OpenJS.NodeJS.LTS"
106 Update-SessionPath
95} 107}
96 108
97function Install-Formatters { 109function Install-Formatters {
diff --git a/install-win.ps1 b/install-win.ps1
index 41b3b51..632c25e 100644
--- a/install-win.ps1
+++ b/install-win.ps1
@@ -80,14 +80,31 @@ function Copy-Npmrc {
80 Write-Ok $NpmrcDst 80 Write-Ok $NpmrcDst
81} 81}
82 82
83function Add-BinToUserPath {
84 $binDir = Join-Path $RepoRoot "windows\bin"
85 $userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
86 $entries = $userPath -split ";"
87
88 if ($entries -contains $binDir) {
89 Write-SkipMsg "$binDir bereits im User-PATH"
90 return
91 }
92
93 Write-Step "$binDir zum User-PATH hinzufuegen (enthaelt gmake.cmd)"
94 [Environment]::SetEnvironmentVariable("PATH", "$userPath;$binDir", "User")
95 Write-Ok "$binDir (wirkt erst in neuen Terminal-Sitzungen)"
96}
97
83function Main { 98function Main {
84 Copy-NvimConfig 99 Copy-NvimConfig
85 Copy-GitConfig 100 Copy-GitConfig
86 Copy-Npmrc 101 Copy-Npmrc
102 Add-BinToUserPath
87 103
88 Write-Host "" 104 Write-Host ""
89 Write-Host "Fertig. Dateien wurden KOPIERT, nicht verlinkt." -ForegroundColor Green 105 Write-Host "Fertig. Dateien wurden KOPIERT, nicht verlinkt." -ForegroundColor Green
90 Write-Host "Nach Aenderungen im Repo dieses Skript erneut ausfuehren." 106 Write-Host "Nach Aenderungen im Repo dieses Skript erneut ausfuehren."
107 Write-Host "Neues Terminal oeffnen, damit PATH-Aenderungen wirksam werden." -ForegroundColor Yellow
91} 108}
92 109
93Main 110Main