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 /install-win.ps1 | |
| 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.
Diffstat (limited to 'install-win.ps1')
| -rw-r--r-- | install-win.ps1 | 20 |
1 files changed, 17 insertions, 3 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 | ||
