2025-08-26 21:57:57 -06:00
|
|
|
<<<<<<< HEAD
|
2025-08-26 15:59:26 -06:00
|
|
|
# Update subfolders with the latest UpdateSequences and UpdateAllSequences scripts
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
$sourceBat = "A:\1 Amazon_Active_Projects\3 ProjectStructure\UpdateSequences.bat"
|
2025-08-19 12:11:03 -06:00
|
|
|
$sourcePs1 = "A:\1 Amazon_Active_Projects\3 ProjectStructure\UpdateSequences.ps1"
|
2025-08-26 15:59:26 -06:00
|
|
|
$sourceAllBat = "A:\1 Amazon_Active_Projects\3 ProjectStructure\UpdateAllSequences.bat"
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
if (-not (Test-Path $sourceBat)) { Write-Error "Source file not found: $sourceBat"; exit 1 }
|
|
|
|
|
if (-not (Test-Path $sourcePs1)) { Write-Error "Source PowerShell file not found: $sourcePs1"; exit 1 }
|
|
|
|
|
if (-not (Test-Path $sourceAllBat)) { Write-Error "Source file not found: $sourceAllBat"; exit 1 }
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
$root = "A:\1 Amazon_Active_Projects"
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
$specs = @(
|
2025-08-26 16:14:56 -06:00
|
|
|
@{ Name = "UpdateSequences.bat"; Source = $sourceBat },
|
|
|
|
|
@{ Name = "UpdateSequences.ps1"; Source = $sourcePs1 },
|
|
|
|
|
@{ Name = "UpdateAllSequences.bat"; Source = $sourceAllBat }
|
2025-08-26 15:59:26 -06:00
|
|
|
)
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
$grandTotal = 0
|
|
|
|
|
$grandUpdated = 0
|
|
|
|
|
$grandFailed = 0
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
foreach ($spec in $specs) {
|
|
|
|
|
Write-Host "=== Updating $($spec.Name) files ===" -ForegroundColor Cyan
|
|
|
|
|
Write-Host "Source: $($spec.Source)" -ForegroundColor White
|
|
|
|
|
Write-Host ""
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
$targets = Get-ChildItem -Path $root -Recurse -Filter $spec.Name | Where-Object { $_.FullName -ne $spec.Source }
|
|
|
|
|
Write-Host "Found $($targets.Count) target files to update:" -ForegroundColor Yellow
|
|
|
|
|
foreach ($t in $targets) { Write-Host " - $($t.FullName)" -ForegroundColor Gray }
|
|
|
|
|
Write-Host ""
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
$updated = 0
|
|
|
|
|
$failed = 0
|
|
|
|
|
foreach ($t in $targets) {
|
|
|
|
|
try {
|
|
|
|
|
Copy-Item -Path $spec.Source -Destination $t.FullName -Force
|
2025-08-26 16:14:56 -06:00
|
|
|
Write-Host " Updated: $($t.FullName)" -ForegroundColor Green
|
2025-08-26 15:59:26 -06:00
|
|
|
$updated++
|
|
|
|
|
}
|
|
|
|
|
catch {
|
2025-08-26 16:14:56 -06:00
|
|
|
Write-Host " Failed to update: $($t.FullName)" -ForegroundColor Red
|
2025-08-26 15:59:26 -06:00
|
|
|
Write-Host " Error: $($_.Exception.Message)" -ForegroundColor Red
|
|
|
|
|
$failed++
|
|
|
|
|
}
|
2025-08-19 12:11:03 -06:00
|
|
|
}
|
|
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
Write-Host ""
|
|
|
|
|
Write-Host "=== $($spec.Name) SUMMARY ===" -ForegroundColor Magenta
|
|
|
|
|
Write-Host "Successfully updated: $updated" -ForegroundColor Green
|
|
|
|
|
Write-Host "Failed updates: $failed" -ForegroundColor Red
|
|
|
|
|
Write-Host "Total targets: $($targets.Count)" -ForegroundColor White
|
|
|
|
|
Write-Host ""
|
|
|
|
|
|
|
|
|
|
$grandTotal += $targets.Count
|
|
|
|
|
$grandUpdated += $updated
|
|
|
|
|
$grandFailed += $failed
|
|
|
|
|
}
|
2025-08-19 12:11:03 -06:00
|
|
|
|
2025-08-26 15:59:26 -06:00
|
|
|
Write-Host "=== OVERALL SUMMARY ===" -ForegroundColor Magenta
|
|
|
|
|
Write-Host "Total targets across all files: $grandTotal" -ForegroundColor White
|
|
|
|
|
Write-Host "Total successfully updated: $grandUpdated" -ForegroundColor Green
|
|
|
|
|
Write-Host "Total failed: $grandFailed" -ForegroundColor Red
|
|
|
|
|
if ($grandFailed -eq 0) {
|
|
|
|
|
Write-Host "`nAll files updated successfully." -ForegroundColor Green
|
2025-08-19 12:11:03 -06:00
|
|
|
} else {
|
2025-08-26 15:59:26 -06:00
|
|
|
Write-Host "`nSome updates failed. See errors above." -ForegroundColor Yellow
|
2025-08-26 21:57:57 -06:00
|
|
|
=======
|
2025-08-20 18:23:14 -06:00
|
|
|
# Copy the current UpdateSequences.bat to all subfolders that have it
|
|
|
|
|
|
2025-08-20 18:24:09 -06:00
|
|
|
$sourceFile = "R:\Creative\artsy\maya\0 ProjectStructure\UpdateSequences.bat"
|
2025-08-20 18:23:14 -06:00
|
|
|
|
|
|
|
|
if (-not (Test-Path $sourceFile)) {
|
|
|
|
|
Write-Error "Source file not found: $sourceFile"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-20 18:32:40 -06:00
|
|
|
|
2025-08-20 18:23:14 -06:00
|
|
|
|
|
|
|
|
Write-Host "=== Updating UpdateSequences.bat files ===" -ForegroundColor Cyan
|
|
|
|
|
Write-Host "Source .bat: $sourceFile" -ForegroundColor White
|
|
|
|
|
Write-Host ""
|
|
|
|
|
|
|
|
|
|
# Find all UpdateSequences.bat files
|
2025-08-20 18:24:09 -06:00
|
|
|
$targetFiles = Get-ChildItem -Path "R:\Creative\artsy\maya" -Recurse -Filter "UpdateSequences.bat" | Where-Object { $_.FullName -ne $sourceFile }
|
2025-08-20 18:23:14 -06:00
|
|
|
|
|
|
|
|
Write-Host "Found $($targetFiles.Count) target files to update:" -ForegroundColor Yellow
|
|
|
|
|
foreach ($file in $targetFiles) {
|
|
|
|
|
Write-Host " - $($file.FullName)" -ForegroundColor Gray
|
|
|
|
|
}
|
|
|
|
|
Write-Host ""
|
|
|
|
|
|
|
|
|
|
$updatedCount = 0
|
|
|
|
|
$failedCount = 0
|
|
|
|
|
|
|
|
|
|
foreach ($targetFile in $targetFiles) {
|
|
|
|
|
$targetDir = $targetFile.Directory.FullName
|
|
|
|
|
$targetBat = Join-Path $targetDir "UpdateSequences.bat"
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
# Copy the .bat file
|
|
|
|
|
Copy-Item -Path $sourceFile -Destination $targetBat -Force
|
|
|
|
|
Write-Host "✓ Updated: $targetBat" -ForegroundColor Green
|
|
|
|
|
|
|
|
|
|
$updatedCount++
|
|
|
|
|
}
|
|
|
|
|
catch {
|
|
|
|
|
Write-Host "✗ Failed to update: $targetBat" -ForegroundColor Red
|
|
|
|
|
Write-Host " Error: $($_.Exception.Message)" -ForegroundColor Red
|
|
|
|
|
$failedCount++
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Host ""
|
|
|
|
|
Write-Host "=== SUMMARY ===" -ForegroundColor Magenta
|
|
|
|
|
Write-Host "Successfully updated: $updatedCount" -ForegroundColor Green
|
|
|
|
|
Write-Host "Failed updates: $failedCount" -ForegroundColor Red
|
|
|
|
|
Write-Host "Total targets: $($targetFiles.Count)" -ForegroundColor White
|
|
|
|
|
|
|
|
|
|
if ($failedCount -eq 0) {
|
|
|
|
|
Write-Host "`n🎉 All UpdateSequences.bat files have been successfully updated!" -ForegroundColor Green
|
|
|
|
|
} else {
|
|
|
|
|
Write-Host "`n⚠️ Some files failed to update. Check the errors above." -ForegroundColor Yellow
|
2025-08-26 21:57:57 -06:00
|
|
|
>>>>>>> d89d8e0cf215637d0ffabf165877815ab4203f37
|
2025-08-19 12:11:03 -06:00
|
|
|
}
|