Fix packaged project archive command
This commit is contained in:
@@ -2,12 +2,21 @@ from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from uuid import UUID
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
# Direct execution from /app/scripts must resolve the repository's backend
|
||||
# package before similarly named installed packages.
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
BACKEND_ROOT = ROOT / "backend" if (ROOT / "backend" / "app").is_dir() else ROOT
|
||||
if str(BACKEND_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(BACKEND_ROOT))
|
||||
|
||||
from app.db.session import SessionLocal
|
||||
from app.models import Project
|
||||
|
||||
|
||||
Reference in New Issue
Block a user