E-slam's picture
Update main.py
8fc9334 verified
raw
history blame
704 Bytes
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")