wishwakankanamg commited on
Commit
831c5eb
·
1 Parent(s): a9bcab4

attem-pting startup script

Browse files
Files changed (2) hide show
  1. app.py +12 -0
  2. app.sh +8 -0
app.py CHANGED
@@ -13,6 +13,18 @@ from pydantic import BaseModel
13
  from pathlib import Path
14
 
15
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  load_dotenv()
17
 
18
 
 
13
  from pathlib import Path
14
 
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
+ except Exception as e:
23
+ print(f"Git update failed: {e}")
24
+
25
+ update_repo()
26
+
27
+
28
  load_dotenv()
29
 
30
 
app.sh ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ echo "Fetching latest code from origin/main..."
4
+ git fetch origin
5
+ git reset --hard origin/main
6
+
7
+ echo "Starting the app..."
8
+ python app.py # or whatever your main entry point is