E-slam commited on
Commit
8fc9334
·
verified ·
1 Parent(s): cec2bc6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +13 -10
main.py CHANGED
@@ -1,22 +1,25 @@
1
  import subprocess
 
 
2
 
 
3
  subprocess.call(["pip", "install", "flet==0.19.0"])
4
  subprocess.call(["pip", "install", "flet_fastapi==0.19.0"])
5
 
6
- import os
7
- import time
8
-
9
  gh_token = os.getenv("gh_token")
10
 
11
- url_with_token = "https://" + gh_token + "@github.com/Eslam-Magdy-1297/ESearch_FletV01.git"
 
12
 
 
13
  os.system(f"git clone {url_with_token}")
14
-
15
- time.sleep(10)
16
 
17
- files = os.listdir()
 
18
 
19
- for file in files:
20
- print(file)
21
 
22
- os.system("python ESearch_FletV01/main.py")
 
 
1
  import subprocess
2
+ import os
3
+ import time
4
 
5
+ # Install required packages
6
  subprocess.call(["pip", "install", "flet==0.19.0"])
7
  subprocess.call(["pip", "install", "flet_fastapi==0.19.0"])
8
 
9
+ # Get GitHub token from environment variable
 
 
10
  gh_token = os.getenv("gh_token")
11
 
12
+ # Construct GitHub URL with token for cloning
13
+ url_with_token = f"https://{gh_token}@github.com/Eslam-Magdy-1297/ESearch_FletV01.git"
14
 
15
+ # Clone the repository
16
  os.system(f"git clone {url_with_token}")
 
 
17
 
18
+ # Wait for cloning to complete
19
+ time.sleep(10)
20
 
21
+ # Copy main.py to current directory, replacing existing files
22
+ os.system("cp -f ESearch_FletV01/main.py ./")
23
 
24
+ # Optionally, you may want to execute the main.py file here
25
+ os.system("python main.py")