diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-07-24 10:32:42 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-07-24 10:32:42 +0200 |
| commit | b91319846c364030074726fba73e76f19713e69d (patch) | |
| tree | 48da13081a154598c1d8c5aac831630b850173bb | |
| parent | c1e4fdb0b9eaf0a6ff2f73ae732970e9b956b05f (diff) | |
| download | dotfiles-b91319846c364030074726fba73e76f19713e69d.tar.gz dotfiles-b91319846c364030074726fba73e76f19713e69d.tar.bz2 dotfiles-b91319846c364030074726fba73e76f19713e69d.zip | |
windows: eigene npmrc-Variante ohne ${HOME} (npm/npmrc-win)
npm/npmrc setzt prefix=${HOME}/.local, damit globale npm-Installationen
ohne sudo/root ins Home-Verzeichnis gehen. HOME ist unter Windows i.d.R.
nicht gesetzt, ${HOME} wuerde also nicht expandieren.
npm/npmrc-win laesst prefix komplett weg - npm nutzt unter Windows
ohnehin schon %APPDATA%\npm als Praefix, von Node's eigenem Installer
automatisch zum PATH hinzugefuegt, kein Workaround noetig.
install-win.ps1 und neovim-windows-setup.md entsprechend angepasst.
npm/npmrc (POSIX) bleibt unveraendert.
| -rw-r--r-- | install-win.ps1 | 4 | ||||
| -rw-r--r-- | neovim-windows-setup.md | 2 | ||||
| -rw-r--r-- | npm/npmrc-win | 26 |
3 files changed, 29 insertions, 3 deletions
diff --git a/install-win.ps1 b/install-win.ps1 index 632c25e..e52c0cb 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" | 44 | $NpmrcSrc = Join-Path $RepoRoot "npm\npmrc-win" |
| 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,7 +75,7 @@ function Copy-Npmrc { | |||
| 75 | return | 75 | return |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | Write-Step "npm\npmrc -> $NpmrcDst" | 78 | Write-Step "npm\npmrc-win -> $NpmrcDst" |
| 79 | Copy-Item -Force $NpmrcSrc $NpmrcDst | 79 | Copy-Item -Force $NpmrcSrc $NpmrcDst |
| 80 | Write-Ok $NpmrcDst | 80 | Write-Ok $NpmrcDst |
| 81 | } | 81 | } |
diff --git a/neovim-windows-setup.md b/neovim-windows-setup.md index f7dd1c8..c5fc3fc 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` → `%USERPROFILE%\.npmrc` (nur falls dort noch keine Datei existiert) | 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 |
| 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 new file mode 100644 index 0000000..3803390 --- /dev/null +++ b/npm/npmrc-win | |||
| @@ -0,0 +1,26 @@ | |||
| 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 | ||
