update line endings

This commit is contained in:
2025-09-15 12:42:59 -05:00
parent ae33b35354
commit ba21798a22
2 changed files with 65 additions and 6 deletions

View File

@@ -63,9 +63,9 @@ with open(config_file_path, 'w', encoding='utf-8') as configfile:
print(f"Updated Nextcloud configuration in {config_file_path}") print(f"Updated Nextcloud configuration in {config_file_path}")
print("\nChanges made:") print("\nChanges made:")
print(" Reduced poll interval to 5 seconds (was 30 seconds)") print("✓ Reduced poll interval to 5 seconds (was 30 seconds)")
print(" Added force sync every hour") print("✓ Added force sync every hour")
print(" Enabled ETag support for better change detection") print("✓ Enabled ETag support for better change detection")
print(" Added network timeout improvements") print("✓ Added network timeout improvements")
print(" Enabled detailed logging for debugging") print("✓ Enabled detailed logging for debugging")
print(" Ensured folder sync is not paused") print("✓ Ensured folder sync is not paused")

View File

@@ -0,0 +1,59 @@
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
# Script to normalize line endings in text files
Write-Host "Normalizing line endings in workspace files to LF..." -ForegroundColor Cyan
# Text file extensions to process
$textExtensions = @("*.ps1", "*.txt", "*.json", "*.js", "*.py", "*.csv", "*.md", "*.ini", "*.sh")
# Get all text files
$textFiles = Get-ChildItem -Path $PSScriptRoot -Include $textExtensions -Recurse -File
$count = 0
foreach ($file in $textFiles) {
Write-Host "Processing: $($file.Name)" -ForegroundColor DarkGray
try {
# Read file content with current line endings
$content = Get-Content -Path $file.FullName -Raw -ErrorAction Stop
if ($content) {
# Replace CRLF with LF
$normalizedContent = $content.Replace("`r`n", "`n")
# Check if content was changed
if ($normalizedContent -ne $content) {
# Write back with LF endings
$utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $false
[System.IO.File]::WriteAllText($file.FullName, $normalizedContent, $utf8NoBomEncoding)
Write-Host " - Normalized: $($file.Name)" -ForegroundColor Green
$count++
} else {
Write-Host " - Already has LF endings: $($file.Name)" -ForegroundColor DarkGray
}
}
} catch {
Write-Host " - Error processing $($file.Name): $_" -ForegroundColor Red
}
}
Write-Host "`nNormalization complete! Converted $count files to LF line endings." -ForegroundColor Cyan
# Update your Git configuration for this repository
Write-Host "`nUpdating Git configuration to use LF line endings..." -ForegroundColor Cyan
try {
# Ensure Git uses LF in the repo
& git config core.eol lf
& git config core.autocrlf false
Write-Host "Git configuration updated." -ForegroundColor Green
Write-Host "- core.eol: lf" -ForegroundColor DarkGray
Write-Host "- core.autocrlf: false" -ForegroundColor DarkGray
} catch {
Write-Host "Failed to update Git configuration: $_" -ForegroundColor Red
}
Write-Host "`nTo verify changes, run your update check again." -ForegroundColor Yellow