Use host ports 3006/8005 and 3096/8096 so Kansho does not collide with Bookstack on 3005 or the sister products. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
803 B
PowerShell
30 lines
803 B
PowerShell
# Wrapper for backend/sqlite_to_postgres.py (personal data, require -Confirm).
|
|
[CmdletBinding()]
|
|
param(
|
|
[string]$Sqlite,
|
|
[string]$MediaSrc,
|
|
[string]$MediaDest,
|
|
[switch]$Confirm,
|
|
[switch]$Replace
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
Set-StrictMode -Version Latest
|
|
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
$py = Join-Path $root "backend\.venv\Scripts\python.exe"
|
|
if (-not (Test-Path $py)) {
|
|
$py = "python"
|
|
}
|
|
|
|
$env:PYTHONUTF8 = "1"
|
|
$argsList = @((Join-Path $root "backend\sqlite_to_postgres.py"))
|
|
if ($Sqlite) { $argsList += @("--sqlite", $Sqlite) }
|
|
if ($MediaSrc) { $argsList += @("--media-src", $MediaSrc) }
|
|
if ($MediaDest) { $argsList += @("--media-dest", $MediaDest) }
|
|
if ($Confirm) { $argsList += "--confirm" }
|
|
if ($Replace) { $argsList += "--replace" }
|
|
|
|
& $py @argsList
|
|
exit $LASTEXITCODE
|