Spaces:
Sleeping
Sleeping
File size: 826 Bytes
8934152 03bb562 8934152 |
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 |
from git import Repo
import os
import subprocess
GITHUB_PAT = os.getenv('GITHUB_PAT')
GIT_USER = os.getenv('GIT_USER')
GIT_REPO = os.getenv('GIT_REPO')
if GITHUB_PAT:
print("GITHUB_PAT set")
if not os.path.exists('cloned_repo'):
Repo.clone_from(f'https://github.com/zihanxing/decorx-rowe-tool', './cloned_repo')
# Install Python dependencies
subprocess.run(['pip', 'install', '-r', 'cloned_repo/requirements.txt'])
# Install system-level dependencies if packages.txt exists
if os.path.exists('cloned_repo/packages.txt'):
with open('cloned_repo/packages.txt') as f:
packages = f.read().splitlines()
if packages:
subprocess.run(['apt-get', 'update'])
subprocess.run(['apt-get', 'install', '-y'] + packages)
import cloned_repo.main as main
from cloned_repo.main import *
|