Files
bible-app/monitor-and-fix-extraction.ps1
christianandClaude Opus 5 0db5e9b07d Bible App 1.4.34 — full source
First commit on the local Gitea server, made after moving the tree off the
Windows machine. Build outputs, node_modules and the AI models stay out
(see .gitignore); everything the installer build needs is tracked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-24 13:05:20 -04:00

59 lines
2.3 KiB
PowerShell

# Monitor electron-builder cache and fix symlink extraction errors in real-time
$cacheDir = "$env:LOCALAPPDATA\electron-builder\Cache\winCodeSign"
$maxWait = 120 # Wait up to 2 minutes
$checkInterval = 0.5 # Check every 500ms
Write-Host "Monitoring for winCodeSign extraction..."
for ($i = 0; $i -lt ($maxWait * 2); $i++) {
Start-Sleep -Milliseconds ($checkInterval * 1000)
# Look for .7z files that were just downloaded
$archives = Get-ChildItem -Path $cacheDir -Filter "*.7z" -ErrorAction SilentlyContinue |
Where-Object { $_.LastWriteTime -gt (Get-Date).AddMinutes(-5) } |
Sort-Object LastWriteTime -Descending
foreach ($archive in $archives) {
# Check for extraction directories (random numbers)
$extractDirs = Get-ChildItem -Path $cacheDir -Directory -ErrorAction SilentlyContinue |
Where-Object { $_.Name -match '^\d+$' -and $_.LastWriteTime -gt (Get-Date).AddMinutes(-2) }
foreach ($dir in $extractDirs) {
$symlinks = @(
"darwin\10.12\lib\libcrypto.dylib",
"darwin\10.12\lib\libssl.dylib"
)
$needsFix = $false
foreach ($symlink in $symlinks) {
$symlinkPath = Join-Path $dir.FullName $symlink
if (-not (Test-Path $symlinkPath)) {
$needsFix = $true
break
}
}
if ($needsFix) {
Write-Host "Fixing symlinks in: $($dir.Name)"
foreach ($symlink in $symlinks) {
$symlinkPath = Join-Path $dir.FullName $symlink
$symlinkDir = Split-Path $symlinkPath -Parent
if (-not (Test-Path $symlinkDir)) {
New-Item -ItemType Directory -Path $symlinkDir -Force | Out-Null
}
if (-not (Test-Path $symlinkPath)) {
New-Item -ItemType File -Path $symlinkPath -Force | Out-Null
}
}
Write-Host "Fixed symlinks in: $($dir.Name)"
}
}
}
}
Write-Host "Monitoring complete"
exit 0