crafty-4/app/classes/shared/installer.py
Iain Powrie e0ce1d118c Create pylintrc, code review pipeline & correct codebase errors
Fix uploads,
Only send server stats to user page when they have access to servers
2022-01-26 01:45:30 +00:00

24 lines
627 B
Python

import sys
import subprocess
class install:
@staticmethod
def is_venv():
return (hasattr(sys, 'real_prefix') or
(hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix))
def do_install(self):
# are we in a venv?
if not self.is_venv():
print("Crafty Requires a venv to install")
sys.exit(1)
# do our pip install
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", 'requirements.txt'])
print("Crafty has installed it's dependencies, please restart Crafty")
sys.exit(0)
installer = install()