Spaces:
Sleeping
Sleeping
ZaaachX
commited on
Commit
·
8934152
1
Parent(s):
10a9a84
init commit
Browse files- .gitignore +1 -0
- app.py +24 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.env
|
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from git import Repo
|
2 |
+
import os
|
3 |
+
import subprocess
|
4 |
+
|
5 |
+
GITHUB_PAT = os.getenv('GITHUB_PAT')
|
6 |
+
GIT_USER = os.getenv('GIT_USER')
|
7 |
+
GIT_REPO = os.getenv('GIT_REPO')
|
8 |
+
|
9 |
+
if not os.path.exists('cloned_repo'):
|
10 |
+
Repo.clone_from(f'https://github.com/zihanxing/decorx-rowe-tool', './cloned_repo')
|
11 |
+
|
12 |
+
# Install Python dependencies
|
13 |
+
subprocess.run(['pip', 'install', '-r', 'cloned_repo/requirements.txt'])
|
14 |
+
|
15 |
+
# Install system-level dependencies if packages.txt exists
|
16 |
+
if os.path.exists('cloned_repo/packages.txt'):
|
17 |
+
with open('cloned_repo/packages.txt') as f:
|
18 |
+
packages = f.read().splitlines()
|
19 |
+
if packages:
|
20 |
+
subprocess.run(['apt-get', 'update'])
|
21 |
+
subprocess.run(['apt-get', 'install', '-y'] + packages)
|
22 |
+
|
23 |
+
import cloned_repo.main as main
|
24 |
+
from cloned_repo.main import *
|