Add CYD browser flasher with Next.js, i18n, and Web Serial install.
Replace the starter app with a public/local flasher that discovers sibling firmwares, supports en/zh, and documents HTTPS deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
37
scripts/sync-firmware.ps1
Normal file
37
scripts/sync-firmware.ps1
Normal file
@@ -0,0 +1,37 @@
|
||||
# Mirror sibling project firmware archives into cydweb/firmware for public deploy.
|
||||
# Usage (from cydweb):
|
||||
# .\scripts\sync-firmware.ps1
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
|
||||
$cydRoot = Split-Path -Parent $root
|
||||
$dstRoot = Join-Path $root "firmware"
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $dstRoot | Out-Null
|
||||
|
||||
$required = @("bootloader.bin", "partitions.bin", "boot_app0.bin", "firmware.bin")
|
||||
$count = 0
|
||||
|
||||
Get-ChildItem $cydRoot -Directory | Where-Object { $_.Name -ne "cydweb" } | ForEach-Object {
|
||||
$proj = $_.Name
|
||||
$fwRoot = Join-Path $_.FullName "firmware"
|
||||
if (-not (Test-Path $fwRoot)) { return }
|
||||
|
||||
Get-ChildItem $fwRoot -Directory -ErrorAction SilentlyContinue | ForEach-Object {
|
||||
$variant = $_.Name
|
||||
$src = $_.FullName
|
||||
$ok = $true
|
||||
foreach ($f in $required) {
|
||||
if (-not (Test-Path (Join-Path $src $f))) { $ok = $false; break }
|
||||
}
|
||||
if (-not $ok) { return }
|
||||
|
||||
$dst = Join-Path $dstRoot (Join-Path $proj $variant)
|
||||
New-Item -ItemType Directory -Force -Path $dst | Out-Null
|
||||
Copy-Item (Join-Path $src "*") $dst -Force -Recurse
|
||||
Write-Host "Synced $proj/$variant"
|
||||
$script:count++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Done. $count firmware package(s) -> $dstRoot"
|
||||
Reference in New Issue
Block a user