diff options
Diffstat (limited to 'bootstrap-win')
| -rw-r--r-- | bootstrap-win/neovim.ps1 | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bootstrap-win/neovim.ps1 b/bootstrap-win/neovim.ps1 index a20f291..aa17dcf 100644 --- a/bootstrap-win/neovim.ps1 +++ b/bootstrap-win/neovim.ps1 | |||
| @@ -118,7 +118,7 @@ function Test-BinaryRuns([string]$Binary, [string[]]$VerifyArgs) { | |||
| 118 | } | 118 | } |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | function Install-NpmPackage([string]$Binary, [string]$Package, [string[]]$VerifyArgs = $null) { | 121 | function Install-NpmPackage([string]$Binary, [string]$Package, [string[]]$VerifyArgs = $null, [switch]$AllowScripts) { |
| 122 | if (Test-CommandExists $Binary) { | 122 | if (Test-CommandExists $Binary) { |
| 123 | if ($VerifyArgs -and -not (Test-BinaryRuns $Binary $VerifyArgs)) { | 123 | if ($VerifyArgs -and -not (Test-BinaryRuns $Binary $VerifyArgs)) { |
| 124 | Write-Warn "'$Binary' ist im PATH, laesst sich aber nicht ausfuehren - vermutlich hat der Post-Install-Download von '$Package' nicht geklappt (Proxy/ignore-scripts pruefen). 'npm uninstall -g $Package' und neu installieren." | 124 | Write-Warn "'$Binary' ist im PATH, laesst sich aber nicht ausfuehren - vermutlich hat der Post-Install-Download von '$Package' nicht geklappt (Proxy/ignore-scripts pruefen). 'npm uninstall -g $Package' und neu installieren." |
| @@ -133,8 +133,17 @@ function Install-NpmPackage([string]$Binary, [string]$Package, [string[]]$Verify | |||
| 133 | return | 133 | return |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | Write-Step "npm install -g $Package" | 136 | # -AllowScripts: fuer Pakete wie tree-sitter-cli, deren Post-Install-Skript |
| 137 | npm install -g $Package | Out-Null | 137 | # die eigentliche native Binary von GitHub nachlaedt. Die globale |
| 138 | # ignore-scripts=true in der npmrc wuerde das verhindern; --no-ignore-scripts | ||
| 139 | # hebt das nur fuer diesen einen Aufruf auf, ohne die npmrc anzufassen. | ||
| 140 | $npmArgs = @("install", "-g", $Package) | ||
| 141 | if ($AllowScripts) { | ||
| 142 | $npmArgs += "--no-ignore-scripts" | ||
| 143 | } | ||
| 144 | |||
| 145 | Write-Step "npm $($npmArgs -join ' ')" | ||
| 146 | npm @npmArgs | Out-Null | ||
| 138 | 147 | ||
| 139 | if ($LASTEXITCODE -ne 0) { | 148 | if ($LASTEXITCODE -ne 0) { |
| 140 | Write-Warn "npm install -g $Package fehlgeschlagen." | 149 | Write-Warn "npm install -g $Package fehlgeschlagen." |
| @@ -182,7 +191,7 @@ function Install-Formatters { | |||
| 182 | function Install-Tools { | 191 | function Install-Tools { |
| 183 | Install-WingetPackage -Binary "rg" -Id "BurntSushi.ripgrep.MSVC" | 192 | Install-WingetPackage -Binary "rg" -Id "BurntSushi.ripgrep.MSVC" |
| 184 | Install-WingetPackage -Binary "fd" -Id "sharkdp.fd" | 193 | Install-WingetPackage -Binary "fd" -Id "sharkdp.fd" |
| 185 | Install-NpmPackage -Binary "tree-sitter" -Package "tree-sitter-cli" -VerifyArgs @("--version") | 194 | Install-NpmPackage -Binary "tree-sitter" -Package "tree-sitter-cli" -VerifyArgs @("--version") -AllowScripts |
| 186 | 195 | ||
| 187 | # MSVC (cl.exe) ist bereits vorhanden, kein winget-Paket noetig - Neovim | 196 | # MSVC (cl.exe) ist bereits vorhanden, kein winget-Paket noetig - Neovim |
| 188 | # dafuer aber aus einer "Developer PowerShell for VS" starten. | 197 | # dafuer aber aus einer "Developer PowerShell for VS" starten. |
