MVP 0.92
This commit is contained in:
1 parent
60f0d2830d
commit
53b1eff833
62 files changed
+6578
-355
No files matched your search
@@ -0,0 +1,44 @@
|
||||
# Local SQLite+media backup/restore for the holiday test phase.
|
||||
# The archive can contain personal unencrypted journal data. No .env or keys.
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Position = 0)]
|
||||
[ValidateSet("create", "restore")]
|
||||
[string]$Action = "create",
|
||||
[string]$Out,
|
||||
[string]$Archive,
|
||||
[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"
|
||||
$env:PYTHONIOENCODING = "utf-8"
|
||||
|
||||
$argsList = @((Join-Path $root "backend\local_backup.py"), $Action)
|
||||
if ($Action -eq "create" -and $Out) {
|
||||
$argsList += @("--out", $Out)
|
||||
}
|
||||
if ($Action -eq "restore") {
|
||||
if (-not $Archive) {
|
||||
throw "Restore braucht -Archive <pfad>"
|
||||
}
|
||||
$argsList += @($Archive)
|
||||
if ($Confirm) {
|
||||
$argsList += "--confirm"
|
||||
}
|
||||
if ($Replace) {
|
||||
$argsList += "--replace"
|
||||
}
|
||||
}
|
||||
|
||||
& $py @argsList
|
||||
exit $LASTEXITCODE
|
||||
Reference in new issue
Block a user