E-slam's picture
Update main.py
fb908a4 verified
raw
history blame
642 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/app.py ./")
os.system("python app.py")