diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-08-12 09:19:03 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-08-12 09:19:03 +0200 |
| commit | 6e5882a2fd02d30206ab9ca8aa5847b8ea09196c (patch) | |
| tree | 75d3b91f9005e51b93a37b44f3ad23ce4f48bc35 /bootstrap-win | |
| parent | 41c676453cd32fac760ff26e092c9dc81874739f (diff) | |
| download | dotfiles-6e5882a2fd02d30206ab9ca8aa5847b8ea09196c.tar.gz dotfiles-6e5882a2fd02d30206ab9ca8aa5847b8ea09196c.tar.bz2 dotfiles-6e5882a2fd02d30206ab9ca8aa5847b8ea09196c.zip | |
Normalize line endings
Diffstat (limited to 'bootstrap-win')
| -rw-r--r-- | bootstrap-win/git.ps1 | 150 | ||||
| -rw-r--r-- | bootstrap-win/neovim-dict.ps1 | 116 |
2 files changed, 133 insertions, 133 deletions
diff --git a/bootstrap-win/git.ps1 b/bootstrap-win/git.ps1 index 6accba4..8d63338 100644 --- a/bootstrap-win/git.ps1 +++ b/bootstrap-win/git.ps1 | |||
| @@ -1,75 +1,75 @@ | |||
| 1 | #Requires -Version 5.1 | 1 | #Requires -Version 5.1 |
| 2 | <# | 2 | <# |
| 3 | Installiert Git und delta (Pager fuer git/config) per winget. | 3 | Installiert Git und delta (Pager fuer git/config) per winget. |
| 4 | 4 | ||
| 5 | Aufruf (keine Admin-Rechte noetig): | 5 | Aufruf (keine Admin-Rechte noetig): |
| 6 | .\bootstrap-win\git.ps1 | 6 | .\bootstrap-win\git.ps1 |
| 7 | #> | 7 | #> |
| 8 | 8 | ||
| 9 | $ErrorActionPreference = "Stop" | 9 | $ErrorActionPreference = "Stop" |
| 10 | $script:Failures = @() | 10 | $script:Failures = @() |
| 11 | 11 | ||
| 12 | function Write-Ok($msg) { | 12 | function Write-Ok($msg) { |
| 13 | Write-Host "OK $msg" -ForegroundColor Green | 13 | Write-Host "OK $msg" -ForegroundColor Green |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | function Write-Step($msg) { | 16 | function Write-Step($msg) { |
| 17 | Write-Host "==> $msg" -ForegroundColor Cyan | 17 | Write-Host "==> $msg" -ForegroundColor Cyan |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | function Write-Skip($msg) { | 20 | function Write-Skip($msg) { |
| 21 | Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray | 21 | Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | function Write-Warn($msg) { | 24 | function Write-Warn($msg) { |
| 25 | Write-Host "! $msg" -ForegroundColor Yellow | 25 | Write-Host "! $msg" -ForegroundColor Yellow |
| 26 | $script:Failures += $msg | 26 | $script:Failures += $msg |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | function Test-CommandExists([string]$Name) { | 29 | function Test-CommandExists([string]$Name) { |
| 30 | return [bool](Get-Command $Name -ErrorAction SilentlyContinue) | 30 | return [bool](Get-Command $Name -ErrorAction SilentlyContinue) |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | function Install-WingetPackage([string]$Binary, [string]$Id) { | 33 | function Install-WingetPackage([string]$Binary, [string]$Id) { |
| 34 | if (Test-CommandExists $Binary) { | 34 | if (Test-CommandExists $Binary) { |
| 35 | Write-Skip $Binary | 35 | Write-Skip $Binary |
| 36 | return | 36 | return |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | Write-Step "winget install $Id" | 39 | Write-Step "winget install $Id" |
| 40 | $output = winget install --id $Id -e --source winget --accept-package-agreements --accept-source-agreements --silent 2>&1 | 40 | $output = winget install --id $Id -e --source winget --accept-package-agreements --accept-source-agreements --silent 2>&1 |
| 41 | 41 | ||
| 42 | if ($LASTEXITCODE -ne 0) { | 42 | if ($LASTEXITCODE -ne 0) { |
| 43 | $lastLine = ($output | Select-Object -Last 3) -join " / " | 43 | $lastLine = ($output | Select-Object -Last 3) -join " / " |
| 44 | Write-Warn "winget install $Id fehlgeschlagen (Binary '$Binary' nicht gefunden): $lastLine -- Pruefen mit: winget search $Id" | 44 | Write-Warn "winget install $Id fehlgeschlagen (Binary '$Binary' nicht gefunden): $lastLine -- Pruefen mit: winget search $Id" |
| 45 | return | 45 | return |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | Write-Ok $Id | 48 | Write-Ok $Id |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | function Test-Prerequisites { | 51 | function Test-Prerequisites { |
| 52 | if (-not (Test-CommandExists "winget")) { | 52 | if (-not (Test-CommandExists "winget")) { |
| 53 | Write-Host "Fehler: winget wurde nicht gefunden. 'App Installer' aus dem Microsoft Store installieren." -ForegroundColor Red | 53 | Write-Host "Fehler: winget wurde nicht gefunden. 'App Installer' aus dem Microsoft Store installieren." -ForegroundColor Red |
| 54 | exit 1 | 54 | exit 1 |
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | function Main { | 58 | function Main { |
| 59 | Test-Prerequisites | 59 | Test-Prerequisites |
| 60 | 60 | ||
| 61 | Install-WingetPackage -Binary "git" -Id "Git.Git" | 61 | Install-WingetPackage -Binary "git" -Id "Git.Git" |
| 62 | Install-WingetPackage -Binary "delta" -Id "dandavison.delta" | 62 | Install-WingetPackage -Binary "delta" -Id "dandavison.delta" |
| 63 | 63 | ||
| 64 | Write-Host "" | 64 | Write-Host "" |
| 65 | if ($script:Failures.Count -eq 0) { | 65 | if ($script:Failures.Count -eq 0) { |
| 66 | Write-Host "Git-Bootstrap abgeschlossen." -ForegroundColor Green | 66 | Write-Host "Git-Bootstrap abgeschlossen." -ForegroundColor Green |
| 67 | } else { | 67 | } else { |
| 68 | Write-Host "Git-Bootstrap abgeschlossen, mit $($script:Failures.Count) Warnung(en):" -ForegroundColor Yellow | 68 | Write-Host "Git-Bootstrap abgeschlossen, mit $($script:Failures.Count) Warnung(en):" -ForegroundColor Yellow |
| 69 | foreach ($f in $script:Failures) { | 69 | foreach ($f in $script:Failures) { |
| 70 | Write-Host " - $f" -ForegroundColor Yellow | 70 | Write-Host " - $f" -ForegroundColor Yellow |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | Main | 75 | Main |
diff --git a/bootstrap-win/neovim-dict.ps1 b/bootstrap-win/neovim-dict.ps1 index 5aeb117..0068a5e 100644 --- a/bootstrap-win/neovim-dict.ps1 +++ b/bootstrap-win/neovim-dict.ps1 | |||
| @@ -1,58 +1,58 @@ | |||
| 1 | #Requires -Version 5.1 | 1 | #Requires -Version 5.1 |
| 2 | <# | 2 | <# |
| 3 | Windows-natives Pendant zu bootstrap/neovim-dict.sh. | 3 | Windows-natives Pendant zu bootstrap/neovim-dict.sh. |
| 4 | Laedt die deutschen Rechtschreib-Woerterbuecher fuer Neovim herunter. | 4 | Laedt die deutschen Rechtschreib-Woerterbuecher fuer Neovim herunter. |
| 5 | 5 | ||
| 6 | Aufruf: | 6 | Aufruf: |
| 7 | .\bootstrap-win\neovim-dict.ps1 | 7 | .\bootstrap-win\neovim-dict.ps1 |
| 8 | #> | 8 | #> |
| 9 | 9 | ||
| 10 | $ErrorActionPreference = "Stop" | 10 | $ErrorActionPreference = "Stop" |
| 11 | 11 | ||
| 12 | function Write-Ok($msg) { | 12 | function Write-Ok($msg) { |
| 13 | Write-Host "OK $msg" -ForegroundColor Green | 13 | Write-Host "OK $msg" -ForegroundColor Green |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | function Write-Step($msg) { | 16 | function Write-Step($msg) { |
| 17 | Write-Host "==> $msg" -ForegroundColor Cyan | 17 | Write-Host "==> $msg" -ForegroundColor Cyan |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | function Write-SkipMsg($msg) { | 20 | function Write-SkipMsg($msg) { |
| 21 | Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray | 21 | Write-Host "- $msg bereits vorhanden" -ForegroundColor DarkGray |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | $SpellDir = Join-Path $env:LOCALAPPDATA "nvim-data\site\spell" | 24 | $SpellDir = Join-Path $env:LOCALAPPDATA "nvim-data\site\spell" |
| 25 | 25 | ||
| 26 | $Urls = @( | 26 | $Urls = @( |
| 27 | "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl", | 27 | "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl", |
| 28 | "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" | 28 | "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" |
| 29 | ) | 29 | ) |
| 30 | 30 | ||
| 31 | function Get-SpellFile([string]$Url) { | 31 | function Get-SpellFile([string]$Url) { |
| 32 | $fileName = Split-Path -Leaf $Url | 32 | $fileName = Split-Path -Leaf $Url |
| 33 | $dest = Join-Path $SpellDir $fileName | 33 | $dest = Join-Path $SpellDir $fileName |
| 34 | 34 | ||
| 35 | if (Test-Path $dest) { | 35 | if (Test-Path $dest) { |
| 36 | Write-SkipMsg $fileName | 36 | Write-SkipMsg $fileName |
| 37 | return | 37 | return |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | Write-Step "Lade $fileName herunter" | 40 | Write-Step "Lade $fileName herunter" |
| 41 | Invoke-WebRequest -Uri $Url -OutFile $dest | 41 | Invoke-WebRequest -Uri $Url -OutFile $dest |
| 42 | Write-Ok $fileName | 42 | Write-Ok $fileName |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | function Main { | 45 | function Main { |
| 46 | if (-not (Test-Path $SpellDir)) { | 46 | if (-not (Test-Path $SpellDir)) { |
| 47 | New-Item -ItemType Directory -Path $SpellDir -Force | Out-Null | 47 | New-Item -ItemType Directory -Path $SpellDir -Force | Out-Null |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | foreach ($url in $Urls) { | 50 | foreach ($url in $Urls) { |
| 51 | Get-SpellFile $url | 51 | Get-SpellFile $url |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | Write-Host "" | 54 | Write-Host "" |
| 55 | Write-Host "Woerterbuecher fuer Neovim installiert!" -ForegroundColor Green | 55 | Write-Host "Woerterbuecher fuer Neovim installiert!" -ForegroundColor Green |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | Main | 58 | Main |
