Spaces:
Runtime error
Runtime error
Commit
·
c3edd7f
1
Parent(s):
fdcebbb
update
Browse files
app.py
CHANGED
@@ -15,25 +15,19 @@ from pathlib import Path
|
|
15 |
|
16 |
import subprocess
|
17 |
|
18 |
-
def
|
19 |
-
print(f"Running: {description}")
|
20 |
try:
|
21 |
-
subprocess.run(
|
22 |
-
|
23 |
-
|
24 |
-
sys.
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
# Step 2: Install Python dependencies
|
32 |
-
run_command([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"], "Pip install requirements")
|
33 |
-
|
34 |
-
# Step 3: Run your app (replace with the correct entry point)
|
35 |
-
run_command([sys.executable, "app.py"], "Starting the app")
|
36 |
|
|
|
37 |
|
38 |
load_dotenv()
|
39 |
|
@@ -859,5 +853,3 @@ if __name__ == "__main__":
|
|
859 |
|
860 |
|
861 |
|
862 |
-
if __name__ == "__main__":
|
863 |
-
startup()
|
|
|
15 |
|
16 |
import subprocess
|
17 |
|
18 |
+
def update_repo():
|
|
|
19 |
try:
|
20 |
+
subprocess.run(["git", "fetch", "origin"], check=True)
|
21 |
+
subprocess.run(["git", "reset", "--hard", "origin/main"], check=True)
|
22 |
+
# Step 2: Install Python dependencies
|
23 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"], "Pip install requirements")
|
24 |
|
25 |
+
# Step 3: Run your app (replace with the correct entry point)
|
26 |
+
subprocess.run([sys.executable, "app.py"], "Starting the app")
|
27 |
+
except Exception as e:
|
28 |
+
print(f"Git update failed: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
+
update_repo()
|
31 |
|
32 |
load_dotenv()
|
33 |
|
|
|
853 |
|
854 |
|
855 |
|
|
|
|