Initial curated ITWorx_MCP_Hub source from 368fba691ea8d23403b4d56b53b5ec670d7c5020
This commit is contained in:
commit
cb5be898ea
663 files changed
+82674
No files matched your search
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Verify a backup and restore it into a clean target directory."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from packages.hub_operations.backup import BackupManager # noqa: E402
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--backup-root", type=Path, required=True)
|
||||
parser.add_argument("--archive", type=Path, required=True)
|
||||
parser.add_argument("--target-root", type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
artifact = BackupManager(args.backup_root).restore_clean(args.archive, args.target_root)
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"restored": str(args.target_root),
|
||||
"sha256": artifact.sha256,
|
||||
"entries": artifact.entries,
|
||||
},
|
||||
sort_keys=True,
|
||||
)
|
||||
)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in new issue
Block a user