31 lines
1.6 KiB
PowerShell
31 lines
1.6 KiB
PowerShell
# Check only: Renovate runs with the "local" platform directly on this directory
|
|
# and changes nothing. Found updates are read from the JSON report and printed.
|
|
# Renovate requires Node.js >= 24.11
|
|
if ([version](node -v).TrimStart('v') -lt [version]'24.11.0') { throw "Renovate requires Node.js >= 24.11, found: $(node -v). E.g.: volta install node@24" }
|
|
# Report and debug log of this run: reports/<timestamp>/
|
|
$outDir = Join-Path (Join-Path (Join-Path $PSScriptRoot '..') 'reports') (Get-Date -Format 'yyyy-MM-dd-HH-mm-ss-fff')
|
|
$report = Join-Path $outDir 'renovate-report.json'
|
|
New-Item -ItemType Directory -Force -Path $outDir | Out-Null
|
|
|
|
Push-Location (Join-Path $PSScriptRoot '..') # repository root
|
|
# Debug log file: console output in the same format, but at debug level
|
|
$env:LOG_FILE = Join-Path $outDir 'renovate.log'
|
|
$env:LOG_FILE_LEVEL = 'debug'
|
|
$env:LOG_FILE_FORMAT = 'pretty'
|
|
npx --yes renovate@44.149.3 --platform=local --dry-run=lookup --report-type=file --report-path=$report
|
|
Remove-Item Env:LOG_FILE, Env:LOG_FILE_LEVEL, Env:LOG_FILE_FORMAT
|
|
Pop-Location
|
|
|
|
Write-Host "`nAvailable updates:" -ForegroundColor Cyan
|
|
$packageFiles = (Get-Content $report -Raw -Encoding UTF8 | ConvertFrom-Json).repositories.local.packageFiles
|
|
foreach ($manager in $packageFiles.PSObject.Properties) {
|
|
foreach ($file in $manager.Value) {
|
|
foreach ($dep in $file.deps) {
|
|
foreach ($update in $dep.updates) {
|
|
Write-Host " [$($manager.Name)] $($file.packageFile): $($dep.depName) $($dep.currentValue) -> $($update.newValue) ($($update.updateType))"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Write-Host "Report and debug log: $outDir"
|