fix(chezmoi): кириллица в PS-скриптах ломала парсер на Windows

- Зачем:
  - PS 5.1 читает UTF-8 без BOM как системную кодовую страницу;
    байт 0x91 из «Бэкап» интерпретировался как кавычка, ломая парсер.
- Что:
  - заменена кириллица в Write-Host/Write-Warning на английский текст
    в run_20-configure-windows-terminal.ps1 и run_before_10-migrate-gitconfig.ps1.
  - комментарии на русском оставлены (парсер их не обрабатывает).
- Проверка:
  - chezmoi -S "$HOME\dotfiles\chezmoi" apply (на Windows)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ddadminandClaude Opus 4.6 committed 2026-03-22 20:11:32 +03:00
1 parent 8567b2262c
commit 21a6494cc4
2 files changed
+7 -7

No files matched your search

@@ -228,12 +228,12 @@ $Settings.profiles.list = $OrderedArray
# ── Запись, только если что-то реально изменилось ───────────────────── # ── Запись, только если что-то реально изменилось ─────────────────────
if (-not $Changed) { if (-not $Changed) {
Write-Host 'Windows Terminal: настройки уже соответствуют baseline.' Write-Host 'Windows Terminal: settings already match baseline.'
return return
} }
$BackupPath = '{0}.bak-{1}' -f $SettingsPath, (Get-Date -Format 'yyyyMMdd-HHmmss') $BackupPath = '{0}.bak-{1}' -f $SettingsPath, (Get-Date -Format 'yyyyMMdd-HHmmss')
Copy-Item -LiteralPath $SettingsPath -Destination $BackupPath -Force Copy-Item -LiteralPath $SettingsPath -Destination $BackupPath -Force
$Settings | ConvertTo-Json -Depth 100 | Set-Content -LiteralPath $SettingsPath -Encoding utf8BOM $Settings | ConvertTo-Json -Depth 100 | Set-Content -LiteralPath $SettingsPath -Encoding utf8BOM
Write-Host "Windows Terminal: обновлено $SettingsPath" Write-Host "Windows Terminal: updated $SettingsPath"
Write-Host "Бэкап: $BackupPath" Write-Host "Backup: $BackupPath"
@@ -93,12 +93,12 @@ if (-not (Test-Path -LiteralPath $LocalConfig)) {
foreach ($Key in $ManagedKeys) { foreach ($Key in $ManagedKeys) {
git config --file $LocalConfig --unset-all $Key 2>$null git config --file $LocalConfig --unset-all $Key 2>$null
} }
Write-Host "Мигрировано: ~/.gitconfig -> ~/.gitconfig.local" Write-Host "Migrated: ~/.gitconfig -> ~/.gitconfig.local"
Write-Host "Бэкап: $BackupPath" Write-Host "Backup: $BackupPath"
return return
} }
# Случай 4: .gitconfig.local уже есть — просто бэкапим. # Случай 4: .gitconfig.local уже есть — просто бэкапим.
Copy-Item -LiteralPath $GlobalConfig -Destination $BackupPath -Force Copy-Item -LiteralPath $GlobalConfig -Destination $BackupPath -Force
Write-Warning "~/.gitconfig.local уже существует; текущий ~/.gitconfig сохранён в бэкап." Write-Warning "~/.gitconfig.local already exists; current ~/.gitconfig saved as backup."
Write-Host "Бэкап: $BackupPath" Write-Host "Backup: $BackupPath"