diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-07-24 10:36:44 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-07-24 10:36:44 +0200 |
| commit | 7dc291df70e115bf021240d0ea2616dffe28d9c8 (patch) | |
| tree | 9a375853beff04efc28073b0547c803da72a7012 | |
| parent | b91319846c364030074726fba73e76f19713e69d (diff) | |
| download | dotfiles-7dc291df70e115bf021240d0ea2616dffe28d9c8.tar.gz dotfiles-7dc291df70e115bf021240d0ea2616dffe28d9c8.tar.bz2 dotfiles-7dc291df70e115bf021240d0ea2616dffe28d9c8.zip | |
windows: npmrc-win wieder entfernt, prefix beim Kopieren auskommentieren statt zweite Datei zu pflegen
Copy-Npmrc liest npm/npmrc jetzt zeilenweise und kommentiert die
prefix=${HOME}/.local-Zeile beim Schreiben nach %USERPROFILE%\.npmrc
aus, statt eine separate npm/npmrc-win zu unterhalten. Nur eine
npmrc-Datei zu pflegen war der ausdrueckliche Wunsch.
| -rw-r--r-- | install-win.ps1 | 20 | ||||
| -rw-r--r-- | neovim-windows-setup.md | 2 | ||||
| -rw-r--r-- | npm/npmrc-win | 26 |
3 files changed, 18 insertions, 30 deletions
diff --git a/install-win.ps1 b/install-win.ps1 index e52c0cb..15f39e4 100644 --- a/install-win.ps1 +++ b/install-win.ps1 | |||
| @@ -41,7 +41,7 @@ $GitUp2partsSrc = Join-Path $RepoRoot "git\config-up2parts" | |||
| 41 | $GitXdgDir = Join-Path $env:USERPROFILE ".config\git" | 41 | $GitXdgDir = Join-Path $env:USERPROFILE ".config\git" |
| 42 | $GitUp2partsDst = Join-Path $GitXdgDir "config-up2parts" | 42 | $GitUp2partsDst = Join-Path $GitXdgDir "config-up2parts" |
| 43 | 43 | ||
| 44 | $NpmrcSrc = Join-Path $RepoRoot "npm\npmrc-win" | 44 | $NpmrcSrc = Join-Path $RepoRoot "npm\npmrc" |
| 45 | $NpmrcDst = Join-Path $env:USERPROFILE ".npmrc" | 45 | $NpmrcDst = Join-Path $env:USERPROFILE ".npmrc" |
| 46 | 46 | ||
| 47 | function Copy-NvimConfig { | 47 | function Copy-NvimConfig { |
| @@ -75,8 +75,22 @@ function Copy-Npmrc { | |||
| 75 | return | 75 | return |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | Write-Step "npm\npmrc-win -> $NpmrcDst" | 78 | # npm/npmrc setzt "prefix=${HOME}/.local", damit globale npm-Installationen |
| 79 | Copy-Item -Force $NpmrcSrc $NpmrcDst | 79 | # unter POSIX ohne sudo/root ins Home-Verzeichnis gehen. HOME ist unter |
| 80 | # Windows i.d.R. nicht gesetzt, ${HOME} wuerde also nicht expandieren. | ||
| 81 | # Der Grund fuer die Einstellung entfaellt unter Windows ohnehin (npm | ||
| 82 | # nutzt dort schon von Haus aus %APPDATA%\npm, automatisch im PATH) - | ||
| 83 | # die Zeile wird beim Kopieren einfach auskommentiert, statt eine zweite | ||
| 84 | # npmrc-Datei zu pflegen. | ||
| 85 | Write-Step "npm\npmrc -> $NpmrcDst (prefix-Zeile auskommentiert)" | ||
| 86 | $lines = Get-Content -Path $NpmrcSrc | ForEach-Object { | ||
| 87 | if ($_ -match "^\s*prefix\s*=") { | ||
| 88 | "; $_ (unter Windows auskommentiert, siehe install-win.ps1: Copy-Npmrc)" | ||
| 89 | } else { | ||
| 90 | $_ | ||
| 91 | } | ||
| 92 | } | ||
| 93 | Set-Content -Path $NpmrcDst -Value $lines | ||
| 80 | Write-Ok $NpmrcDst | 94 | Write-Ok $NpmrcDst |
| 81 | } | 95 | } |
| 82 | 96 | ||
diff --git a/neovim-windows-setup.md b/neovim-windows-setup.md index c5fc3fc..568638c 100644 --- a/neovim-windows-setup.md +++ b/neovim-windows-setup.md | |||
| @@ -39,7 +39,7 @@ Es kopiert (keine Symlinks, keine Admin-Rechte nötig): | |||
| 39 | - `nvim/` → `%LOCALAPPDATA%\nvim` | 39 | - `nvim/` → `%LOCALAPPDATA%\nvim` |
| 40 | - `git/config` → `%USERPROFILE%\.gitconfig` | 40 | - `git/config` → `%USERPROFILE%\.gitconfig` |
| 41 | - `git/config-up2parts` → `%USERPROFILE%\.config\git\config-up2parts` (Pfad ist im `includeIf` von `git/config` hartkodiert) | 41 | - `git/config-up2parts` → `%USERPROFILE%\.config\git\config-up2parts` (Pfad ist im `includeIf` von `git/config` hartkodiert) |
| 42 | - `npm/npmrc-win` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) – eigene Windows-Variante ohne `prefix=${HOME}/.local`: `HOME` ist unter Windows i. d. R. nicht gesetzt, npm nutzt dort ohnehin schon von Haus aus `%APPDATA%\npm` als Praefix | 42 | - `npm/npmrc` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) – die Zeile `prefix=${HOME}/.local` wird dabei auskommentiert: `HOME` ist unter Windows i. d. R. nicht gesetzt, npm nutzt dort ohnehin schon von Haus aus `%APPDATA%\npm` als Präfix |
| 43 | 43 | ||
| 44 | Nach Änderungen im Repo `install-win.ps1` erneut ausführen, um die Kopien zu aktualisieren. | 44 | Nach Änderungen im Repo `install-win.ps1` erneut ausführen, um die Kopien zu aktualisieren. |
| 45 | 45 | ||
diff --git a/npm/npmrc-win b/npm/npmrc-win deleted file mode 100644 index 3803390..0000000 --- a/npm/npmrc-win +++ /dev/null | |||
| @@ -1,26 +0,0 @@ | |||
| 1 | ; %USERPROFILE%\.npmrc (Windows) | ||
| 2 | ; | ||
| 3 | ; Kein "prefix" gesetzt, anders als in npm/npmrc (POSIX): dort dient | ||
| 4 | ; prefix=${HOME}/.local dazu, globale Installationen ohne sudo/root ins | ||
| 5 | ; Home-Verzeichnis zu legen. Unter Windows loest npm dieses Problem | ||
| 6 | ; bereits selbst - der Standard-Praefix liegt ohnehin im Benutzerprofil | ||
| 7 | ; (%APPDATA%\npm), von Node's eigenem Installer automatisch zum PATH | ||
| 8 | ; hinzugefuegt. ${HOME} ist unter Windows i.d.R. nicht gesetzt und wuerde | ||
| 9 | ; hier nicht expandieren. | ||
| 10 | |||
| 11 | ; default registry | ||
| 12 | registry=https://registry.npmjs.org/ | ||
| 13 | |||
| 14 | ; disable fund-spam | ||
| 15 | fund=false | ||
| 16 | |||
| 17 | ; suppresses notifications about new npm versions | ||
| 18 | update-notifier=false | ||
| 19 | |||
| 20 | ; reduce the attack surface for supply chain attacks | ||
| 21 | min-release-age=3 | ||
| 22 | |||
| 23 | ; disable pre- und post-scripts | ||
| 24 | ignore-scripts=true | ||
| 25 | |||
| 26 | ; vim: ft=dosini | ||
