mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30:48 +08:00
Fix retention CLI import path when run from repo root.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
48e5872045
commit
659903506b
1 changed files with 6 additions and 0 deletions
|
|
@ -24,9 +24,15 @@ import argparse
|
|||
import json
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def main() -> int:
|
||||
# Allow `python runtime/operations/scripts/...` from repo root without PYTHONPATH.
|
||||
root = Path(__file__).resolve().parents[3]
|
||||
if str(root) not in sys.path:
|
||||
sys.path.insert(0, str(root))
|
||||
|
||||
p = argparse.ArgumentParser(description=__doc__)
|
||||
p.add_argument("--keep-days", type=int, default=30, help="Retain rows newer than this many days.")
|
||||
p.add_argument("--dry-run", action="store_true", default=False, help="Force dry-run (default).")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue