forked from Yeeb1/HTB-Discord
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtb-discord
More file actions
executable file
·40 lines (34 loc) · 1.05 KB
/
Copy pathhtb-discord
File metadata and controls
executable file
·40 lines (34 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python3
"""
HTB Discord Service Launcher
Run the unified HTB Discord integration service using uv.
"""
import sys
import os
import subprocess
from pathlib import Path
def main():
"""Run HTB Discord service using uv."""
project_root = Path(__file__).parent
# Check if uv is available
try:
subprocess.run(["uv", "--version"], check=True, capture_output=True)
except (subprocess.CalledProcessError, FileNotFoundError):
print("Error: uv is not installed or not in PATH")
print("Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh")
sys.exit(1)
# Change to project directory
os.chdir(project_root)
# Run the service using uv
try:
cmd = ["uv", "run", "htb-discord"] + sys.argv[1:]
result = subprocess.run(cmd)
sys.exit(result.returncode)
except KeyboardInterrupt:
print("\nService interrupted by user")
sys.exit(0)
except Exception as e:
print(f"Service error: {e}")
sys.exit(1)
if __name__ == "__main__":
main()