fix(windows): исправлены LF и совместимость chezmoi с PS 5.1
- Зачем: - нужно убрать line-ending noise в репозитории и сделать Windows-слой безопаснее для запуска без установленного pwsh. - Что: - добавлена `.gitattributes` с LF-базой для текста и CRLF-исключениями для `.bat` и `.cmd`. - `README.md` нормализован в LF и quick start дополнен явной установкой PowerShell 7. - `chezmoi`-скрипты переведены на guard, совместимый с PowerShell 5.1, а запись `settings.json` переведена на `utf8BOM`. - Проверка: - `git diff --check`. - `powershell.exe -NoProfile -ExecutionPolicy Bypass -File chezmoi\\.chezmoiscripts\\run_before_10-migrate-gitconfig.ps1`. - `powershell.exe -NoProfile -ExecutionPolicy Bypass -File chezmoi\\.chezmoiscripts\\run_20-configure-windows-terminal.ps1`. - `chezmoi -S C:\\Users\\dmitry\\dotfiles\\chezmoi apply --dry-run --verbose`.
This commit is contained in:
1 parent
9b66fc70fc
commit
f9083af8b2
4 files changed
+7
-3
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.cmd text eol=crlf
|
||||||
@@ -129,6 +129,7 @@ EOF
|
|||||||
**Быстрое применение из уже существующего `~/dotfiles`:**
|
**Быстрое применение из уже существующего `~/dotfiles`:**
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
|
winget install --id Microsoft.PowerShell
|
||||||
winget install twpayne.chezmoi
|
winget install twpayne.chezmoi
|
||||||
|
|
||||||
# Применить только Windows-layer из репозитория
|
# Применить только Windows-layer из репозитория
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
if (-not $IsWindows) {
|
if (-not ($IsWindows -or $PSVersionTable.PSEdition -eq 'Desktop')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,6 +262,6 @@ if (-not $changed) {
|
|||||||
|
|
||||||
$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 utf8
|
$settings | ConvertTo-Json -Depth 100 | Set-Content -LiteralPath $settingsPath -Encoding utf8BOM
|
||||||
Write-Host "Updated Windows Terminal settings: $settingsPath"
|
Write-Host "Updated Windows Terminal settings: $settingsPath"
|
||||||
Write-Host "Backup saved to: $backupPath"
|
Write-Host "Backup saved to: $backupPath"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
if (-not $IsWindows) {
|
if (-not ($IsWindows -or $PSVersionTable.PSEdition -eq 'Desktop')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user