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. --- install-win.ps1 | 226 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 113 insertions(+), 113 deletions(-) (limited to 'install-win.ps1') diff --git a/install-win.ps1 b/install-win.ps1 index bc73e61..aa77243 100644 --- a/install-win.ps1 +++ b/install-win.ps1 @@ -1,113 +1,113 @@ -#Requires -Version 5.1 -<# - Windows-natives Pendant zu install.sh - kopiert (statt zu verlinken) die - relevanten Konfigurationen an ihre nativen Windows-Zielorte. Keine - Admin-Rechte noetig (keine Symlinks). - - Aufruf: - .\install-win.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" -ForegroundColor DarkGray -} - -$RepoRoot = $PSScriptRoot - -$NvimSrc = Join-Path $RepoRoot "nvim" -$NvimDst = Join-Path $env:LOCALAPPDATA "nvim" - -$GitConfigSrc = Join-Path $RepoRoot "git\config" -$GitConfigDst = Join-Path $env:USERPROFILE ".gitconfig" - -$GitUp2partsSrc = Join-Path $RepoRoot "git\config-up2parts" -$GitXdgDir = Join-Path $env:USERPROFILE ".config\git" -$GitUp2partsDst = Join-Path $GitXdgDir "config-up2parts" - -$NpmrcSrc = Join-Path $RepoRoot "npm\npmrc" -$NpmrcDst = Join-Path $env:USERPROFILE ".npmrc" - -function Copy-NvimConfig { - Write-Step "nvim -> $NvimDst" - - if (Test-Path $NvimDst) { - Remove-Item -Recurse -Force $NvimDst - } - - Copy-Item -Recurse -Force $NvimSrc $NvimDst - Write-Ok $NvimDst -} - -function Copy-GitConfig { - Write-Step "git\config -> $GitConfigDst" - Copy-Item -Force $GitConfigSrc $GitConfigDst - Write-Ok $GitConfigDst - - if (-not (Test-Path $GitXdgDir)) { - New-Item -ItemType Directory -Path $GitXdgDir -Force | Out-Null - } - - Write-Step "git\config-up2parts -> $GitUp2partsDst" - Copy-Item -Force $GitUp2partsSrc $GitUp2partsDst - Write-Ok "$GitUp2partsDst (wird per includeIf aus .gitconfig eingebunden)" -} - -function Copy-Npmrc { - if (Test-Path $NpmrcDst) { - Write-SkipMsg "$NpmrcDst existiert bereits, uebersprungen" - return - } - - # HOME ist unter Windows i.d.R. nicht gesetzt, ${HOME} in npm/npmrc wuerde - # nicht expandieren - Zeile daher auskommentieren statt zweite npmrc-Datei - # zu pflegen. - Write-Step "npm\npmrc -> $NpmrcDst (prefix-Zeile auskommentiert)" - $lines = Get-Content -Path $NpmrcSrc | ForEach-Object { - if ($_ -match "^\s*prefix\s*=") { - "; $_ (unter Windows auskommentiert)" - } else { - $_ - } - } - Set-Content -Path $NpmrcDst -Value $lines - Write-Ok $NpmrcDst -} - -function Add-BinToUserPath { - $binDir = Join-Path $RepoRoot "windows\bin" - $userPath = [Environment]::GetEnvironmentVariable("PATH", "User") - $entries = $userPath -split ";" - - if ($entries -contains $binDir) { - Write-SkipMsg "$binDir bereits im User-PATH" - return - } - - Write-Step "$binDir zum User-PATH hinzufuegen (enthaelt gmake.cmd)" - [Environment]::SetEnvironmentVariable("PATH", "$userPath;$binDir", "User") - Write-Ok "$binDir (wirkt erst in neuen Terminal-Sitzungen)" -} - -function Main { - Copy-NvimConfig - Copy-GitConfig - Copy-Npmrc - Add-BinToUserPath - - Write-Host "" - Write-Host "Fertig. Dateien wurden KOPIERT, nicht verlinkt." -ForegroundColor Green - Write-Host "Nach Aenderungen im Repo dieses Skript erneut ausfuehren." - Write-Host "Neues Terminal oeffnen, damit PATH-Aenderungen wirksam werden." -ForegroundColor Yellow -} - -Main +#Requires -Version 5.1 +<# + Windows-natives Pendant zu install.sh - kopiert (statt zu verlinken) die + relevanten Konfigurationen an ihre nativen Windows-Zielorte. Keine + Admin-Rechte noetig (keine Symlinks). + + Aufruf: + .\install-win.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" -ForegroundColor DarkGray +} + +$RepoRoot = $PSScriptRoot + +$NvimSrc = Join-Path $RepoRoot "nvim" +$NvimDst = Join-Path $env:LOCALAPPDATA "nvim" + +$GitConfigSrc = Join-Path $RepoRoot "git\config" +$GitConfigDst = Join-Path $env:USERPROFILE ".gitconfig" + +$GitUp2partsSrc = Join-Path $RepoRoot "git\config-up2parts" +$GitXdgDir = Join-Path $env:USERPROFILE ".config\git" +$GitUp2partsDst = Join-Path $GitXdgDir "config-up2parts" + +$NpmrcSrc = Join-Path $RepoRoot "npm\npmrc" +$NpmrcDst = Join-Path $env:USERPROFILE ".npmrc" + +function Copy-NvimConfig { + Write-Step "nvim -> $NvimDst" + + if (Test-Path $NvimDst) { + Remove-Item -Recurse -Force $NvimDst + } + + Copy-Item -Recurse -Force $NvimSrc $NvimDst + Write-Ok $NvimDst +} + +function Copy-GitConfig { + Write-Step "git\config -> $GitConfigDst" + Copy-Item -Force $GitConfigSrc $GitConfigDst + Write-Ok $GitConfigDst + + if (-not (Test-Path $GitXdgDir)) { + New-Item -ItemType Directory -Path $GitXdgDir -Force | Out-Null + } + + Write-Step "git\config-up2parts -> $GitUp2partsDst" + Copy-Item -Force $GitUp2partsSrc $GitUp2partsDst + Write-Ok "$GitUp2partsDst (wird per includeIf aus .gitconfig eingebunden)" +} + +function Copy-Npmrc { + if (Test-Path $NpmrcDst) { + Write-SkipMsg "$NpmrcDst existiert bereits, uebersprungen" + return + } + + # HOME ist unter Windows i.d.R. nicht gesetzt, ${HOME} in npm/npmrc wuerde + # nicht expandieren - Zeile daher auskommentieren statt zweite npmrc-Datei + # zu pflegen. + Write-Step "npm\npmrc -> $NpmrcDst (prefix-Zeile auskommentiert)" + $lines = Get-Content -Path $NpmrcSrc | ForEach-Object { + if ($_ -match "^\s*prefix\s*=") { + "; $_ (unter Windows auskommentiert)" + } else { + $_ + } + } + Set-Content -Path $NpmrcDst -Value $lines + Write-Ok $NpmrcDst +} + +function Add-BinToUserPath { + $binDir = Join-Path $RepoRoot "windows\bin" + $userPath = [Environment]::GetEnvironmentVariable("PATH", "User") + $entries = $userPath -split ";" + + if ($entries -contains $binDir) { + Write-SkipMsg "$binDir bereits im User-PATH" + return + } + + Write-Step "$binDir zum User-PATH hinzufuegen (enthaelt gmake.cmd)" + [Environment]::SetEnvironmentVariable("PATH", "$userPath;$binDir", "User") + Write-Ok "$binDir (wirkt erst in neuen Terminal-Sitzungen)" +} + +function Main { + Copy-NvimConfig + Copy-GitConfig + Copy-Npmrc + Add-BinToUserPath + + Write-Host "" + Write-Host "Fertig. Dateien wurden KOPIERT, nicht verlinkt." -ForegroundColor Green + Write-Host "Nach Aenderungen im Repo dieses Skript erneut ausfuehren." + Write-Host "Neues Terminal oeffnen, damit PATH-Aenderungen wirksam werden." -ForegroundColor Yellow +} + +Main -- cgit v1.3