File size: 704 Bytes
1ec044c
8fc9334
 
b1ed202
8fc9334
0116367
f1bf5c1
9b3cfc2
8fc9334
3c2a93b
b1ed202
8fc9334
 
b1ed202
8fc9334
3c2a93b
1623472
8fc9334
 
5b59963
8fc9334
 
c33c8af
8fc9334
 
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
import subprocess
import os
import time

# Install required packages
subprocess.call(["pip", "install", "flet==0.19.0"])
subprocess.call(["pip", "install", "flet_fastapi==0.19.0"])

# Get GitHub token from environment variable
gh_token = os.getenv("gh_token")

# Construct GitHub URL with token for cloning
url_with_token = f"https://{gh_token}@github.com/Eslam-Magdy-1297/ESearch_FletV01.git"

# Clone the repository
os.system(f"git clone {url_with_token}")

# Wait for cloning to complete
time.sleep(10)

# Copy main.py to current directory, replacing existing files
os.system("cp -f ESearch_FletV01/main.py ./")

# Optionally, you may want to execute the main.py file here
os.system("python main.py")