Add dev-prod harmonize tool for bidirectional catalog and image sync.
Schema migrates dev to prod only; catalog rows merge by updated_at and images by mtime with union merge and conflict reporting. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
81ebad2120
commit
f247b418d8
@@ -0,0 +1,27 @@
|
||||
# Map SMB share for harmonize image step (optional wrapper).
|
||||
param(
|
||||
[switch]$SkipConfirm
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
. (Join-Path $PSScriptRoot "lib\Deploy-CliResult.ps1")
|
||||
|
||||
$smbRoot = "\\192.168.10.122\Gallery"
|
||||
if ($env:SMB_USER -and $env:SMB_PASSWORD) {
|
||||
Write-Host "Mapping $smbRoot ..."
|
||||
net use $smbRoot /user:$env:SMB_USER $env:SMB_PASSWORD 2>&1 | Out-Host
|
||||
} elseif (-not (Test-Path $smbRoot)) {
|
||||
Write-Warning "Cannot access $smbRoot (not authenticated)."
|
||||
Write-Warning "Map the share first or set `$env:SMB_USER and `$env:SMB_PASSWORD."
|
||||
}
|
||||
|
||||
$npmArgs = @('run', 'harmonize:images')
|
||||
if ($args.Count -gt 0) {
|
||||
$npmArgs += '--'
|
||||
$npmArgs += $args
|
||||
}
|
||||
|
||||
$RepoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..\..")).Path
|
||||
Set-Location $RepoRoot
|
||||
& npm @npmArgs
|
||||
exit $LASTEXITCODE
|
||||
Reference in New Issue
Block a user