diff options
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 | ||
