forked from CodeGraphContext/CodeGraphContext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcgc_entry.py
More file actions
22 lines (18 loc) · 709 Bytes
/
cgc_entry.py
File metadata and controls
22 lines (18 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# cgc_entry.py
# PyInstaller entrypoint — absolute imports only (no relative imports)
import sys
import os
# When frozen by PyInstaller, sys._MEIPASS is the temp extraction dir.
# We add it to the path so codegraphcontext package is importable.
if getattr(sys, 'frozen', False):
# Running as a PyInstaller bundle
bundle_dir = sys._MEIPASS
sys.path.insert(0, bundle_dir)
# If the process is intended to be a FalkorDB worker (spawned by cgc itself)
if os.getenv('CGC_RUN_FALKOR_WORKER') == 'true':
from codegraphcontext.core.falkor_worker import run_worker
run_worker()
sys.exit(0)
from codegraphcontext.cli.main import app
if __name__ == '__main__':
app()