From 189d244d36d4ebb2189b698adb21f51cf1c4176a Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 12 Aug 2026 09:22:12 +0200 Subject: Revert "Normalize line endings" This reverts commit 6e5882a2fd02d30206ab9ca8aa5847b8ea09196c. --- bootstrap-win/git.ps1 | 150 +++++++++++++++++++++--------------------- bootstrap-win/neovim-dict.ps1 | 116 ++++++++++++++++---------------- 2 files changed, 133 insertions(+), 133 deletions(-) (limited to 'bootstrap-win') diff --git a/bootstrap-win/git.ps1 b/bootstrap-win/git.ps1 index 8d63338..6accba4 100644 --- a/bootstrap-win/git.ps1 +++ b/bootstrap-win/git.ps1 @@ -1,75 +1,75 @@ -#Requires -Version 5.1 -<# - Installiert Git und delta (Pager fuer git/config) per winget. - - Aufruf (keine Admin-Rechte noetig): - .\bootstrap-win\git.ps1 -#> - -$ErrorActionPreference = "Stop" -$script:Failures = @() - -function Write-Ok($msg) { - Write-Host "OK $msg" -ForegroundColor Green -} - -function Write-Step($msg) { - Write-Host "==> $msg" -ForegroundColor Cyan -} - -function Write-Skip($msg) { - Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray -} - -function Write-Warn($msg) { - Write-Host "! $msg" -ForegroundColor Yellow - $script:Failures += $msg -} - -function Test-CommandExists([string]$Name) { - return [bool](Get-Command $Name -ErrorAction SilentlyContinue) -} - -function Install-WingetPackage([string]$Binary, [string]$Id) { - if (Test-CommandExists $Binary) { - Write-Skip $Binary - return - } - - Write-Step "winget install $Id" - $output = winget install --id $Id -e --source winget --accept-package-agreements --accept-source-agreements --silent 2>&1 - - if ($LASTEXITCODE -ne 0) { - $lastLine = ($output | Select-Object -Last 3) -join " / " - Write-Warn "winget install $Id fehlgeschlagen (Binary '$Binary' nicht gefunden): $lastLine -- Pruefen mit: winget search $Id" - return - } - - Write-Ok $Id -} - -function Test-Prerequisites { - if (-not (Test-CommandExists "winget")) { - Write-Host "Fehler: winget wurde nicht gefunden. 'App Installer' aus dem Microsoft Store installieren." -ForegroundColor Red - exit 1 - } -} - -function Main { - Test-Prerequisites - - Install-WingetPackage -Binary "git" -Id "Git.Git" - Install-WingetPackage -Binary "delta" -Id "dandavison.delta" - - Write-Host "" - if ($script:Failures.Count -eq 0) { - Write-Host "Git-Bootstrap abgeschlossen." -ForegroundColor Green - } else { - Write-Host "Git-Bootstrap abgeschlossen, mit $($script:Failures.Count) Warnung(en):" -ForegroundColor Yellow - foreach ($f in $script:Failures) { - Write-Host " - $f" -ForegroundColor Yellow - } - } -} - -Main +#Requires -Version 5.1 +<# + Installiert Git und delta (Pager fuer git/config) per winget. + + Aufruf (keine Admin-Rechte noetig): + .\bootstrap-win\git.ps1 +#> + +$ErrorActionPreference = "Stop" +$script:Failures = @() + +function Write-Ok($msg) { + Write-Host "OK $msg" -ForegroundColor Green +} + +function Write-Step($msg) { + Write-Host "==> $msg" -ForegroundColor Cyan +} + +function Write-Skip($msg) { + Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray +} + +function Write-Warn($msg) { + Write-Host "! $msg" -ForegroundColor Yellow + $script:Failures += $msg +} + +function Test-CommandExists([string]$Name) { + return [bool](Get-Command $Name -ErrorAction SilentlyContinue) +} + +function Install-WingetPackage([string]$Binary, [string]$Id) { + if (Test-CommandExists $Binary) { + Write-Skip $Binary + return + } + + Write-Step "winget install $Id" + $output = winget install --id $Id -e --source winget --accept-package-agreements --accept-source-agreements --silent 2>&1 + + if ($LASTEXITCODE -ne 0) { + $lastLine = ($output | Select-Object -Last 3) -join " / " + Write-Warn "winget install $Id fehlgeschlagen (Binary '$Binary' nicht gefunden): $lastLine -- Pruefen mit: winget search $Id" + return + } + + Write-Ok $Id +} + +function Test-Prerequisites { + if (-not (Test-CommandExists "winget")) { + Write-Host "Fehler: winget wurde nicht gefunden. 'App Installer' aus dem Microsoft Store installieren." -ForegroundColor Red + exit 1 + } +} + +function Main { + Test-Prerequisites + + Install-WingetPackage -Binary "git" -Id "Git.Git" + Install-WingetPackage -Binary "delta" -Id "dandavison.delta" + + Write-Host "" + if ($script:Failures.Count -eq 0) { + Write-Host "Git-Bootstrap abgeschlossen." -ForegroundColor Green + } else { + Write-Host "Git-Bootstrap abgeschlossen, mit $($script:Failures.Count) Warnung(en):" -ForegroundColor Yellow + foreach ($f in $script:Failures) { + Write-Host " - $f" -ForegroundColor Yellow + } + } +} + +Main diff --git a/bootstrap-win/neovim-dict.ps1 b/bootstrap-win/neovim-dict.ps1 index 0068a5e..5aeb117 100644 --- a/bootstrap-win/neovim-dict.ps1 +++ b/bootstrap-win/neovim-dict.ps1 @@ -1,58 +1,58 @@ -#Requires -Version 5.1 -<# - Windows-natives Pendant zu bootstrap/neovim-dict.sh. - Laedt die deutschen Rechtschreib-Woerterbuecher fuer Neovim herunter. - - Aufruf: - .\bootstrap-win\neovim-dict.ps1 -#> - -$ErrorActionPreference = "Stop" - -function Write-Ok($msg) { - Write-Host "OK $msg" -ForegroundColor Green -} - -function Write-Step($msg) { - Write-Host "==> $msg" -ForegroundColor Cyan -} - -function Write-SkipMsg($msg) { - Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray -} - -$SpellDir = Join-Path $env:LOCALAPPDATA "nvim-data\site\spell" - -$Urls = @( - "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl", - "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" -) - -function Get-SpellFile([string]$Url) { - $fileName = Split-Path -Leaf $Url - $dest = Join-Path $SpellDir $fileName - - if (Test-Path $dest) { - Write-SkipMsg $fileName - return - } - - Write-Step "Lade $fileName herunter" - Invoke-WebRequest -Uri $Url -OutFile $dest - Write-Ok $fileName -} - -function Main { - if (-not (Test-Path $SpellDir)) { - New-Item -ItemType Directory -Path $SpellDir -Force | Out-Null - } - - foreach ($url in $Urls) { - Get-SpellFile $url - } - - Write-Host "" - Write-Host "Woerterbuecher fuer Neovim installiert!" -ForegroundColor Green -} - -Main +#Requires -Version 5.1 +<# + Windows-natives Pendant zu bootstrap/neovim-dict.sh. + Laedt die deutschen Rechtschreib-Woerterbuecher fuer Neovim herunter. + + Aufruf: + .\bootstrap-win\neovim-dict.ps1 +#> + +$ErrorActionPreference = "Stop" + +function Write-Ok($msg) { + Write-Host "OK $msg" -ForegroundColor Green +} + +function Write-Step($msg) { + Write-Host "==> $msg" -ForegroundColor Cyan +} + +function Write-SkipMsg($msg) { + Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray +} + +$SpellDir = Join-Path $env:LOCALAPPDATA "nvim-data\site\spell" + +$Urls = @( + "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl", + "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" +) + +function Get-SpellFile([string]$Url) { + $fileName = Split-Path -Leaf $Url + $dest = Join-Path $SpellDir $fileName + + if (Test-Path $dest) { + Write-SkipMsg $fileName + return + } + + Write-Step "Lade $fileName herunter" + Invoke-WebRequest -Uri $Url -OutFile $dest + Write-Ok $fileName +} + +function Main { + if (-not (Test-Path $SpellDir)) { + New-Item -ItemType Directory -Path $SpellDir -Force | Out-Null + } + + foreach ($url in $Urls) { + Get-SpellFile $url + } + + Write-Host "" + Write-Host "Woerterbuecher fuer Neovim installiert!" -ForegroundColor Green +} + +Main -- cgit v1.3