-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_all_repos.ps1
More file actions
75 lines (63 loc) · 2.43 KB
/
sync_all_repos.ps1
File metadata and controls
75 lines (63 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env pwsh
# Comprehensive repository sync script
$rootPath = "$home\Code\asciimath"
$repos = @(
"artificial-gravity-field-generator",
"energy",
"unified-lqg",
"warp-field-coils",
"lqg-positive-matter-assembler",
"warp-sensitivity-analysis",
"warp-convergence-analysis",
"negative-energy-generator",
"polymer-fusion-framework",
"warp-bubble-optimizer",
"lqg-anec-framework",
"medical-tractor-array"
)
$successCount = 0
$totalRepos = $repos.Count
Write-Host "=== Repository Sync Report ===" -ForegroundColor Magenta
Write-Host "Processing $totalRepos key repositories..." -ForegroundColor White
Write-Host ""
foreach ($repo in $repos) {
$repoPath = Join-Path $rootPath $repo
if (Test-Path $repoPath) {
Write-Host "📁 Processing: $repo" -ForegroundColor Cyan
Push-Location $repoPath
try {
# Check repository status
$status = git status --porcelain 2>$null
$isClean = $LASTEXITCODE -eq 0 -and [string]::IsNullOrEmpty($status)
if ($isClean) {
Write-Host " ✅ Repository is clean" -ForegroundColor Green
} else {
Write-Host " ⚠️ Repository has changes" -ForegroundColor Yellow
}
# Attempt push
$pushOutput = git push origin main 2>&1
if ($LASTEXITCODE -eq 0) {
if ($pushOutput -match "Everything up-to-date") {
Write-Host " 📤 Up to date" -ForegroundColor Gray
} else {
Write-Host " 📤 Successfully pushed" -ForegroundColor Green
}
$successCount++
} else {
Write-Host " ❌ Push failed: $pushOutput" -ForegroundColor Red
}
} catch {
Write-Host " ❌ Error: $($_.Exception.Message)" -ForegroundColor Red
} finally {
Pop-Location
}
Write-Host ""
} else {
Write-Host "📁 $repo - Directory not found" -ForegroundColor Red
Write-Host ""
}
}
Write-Host "=== SUMMARY ===" -ForegroundColor Magenta
Write-Host "Repositories processed: $totalRepos" -ForegroundColor White
Write-Host "Successful operations: $successCount" -ForegroundColor Green
Write-Host "Success rate: $([math]::Round(($successCount / $totalRepos) * 100, 1))%" -ForegroundColor Cyan