VyLala commited on
Commit
f5542d0
·
verified ·
1 Parent(s): 700a8a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -10,13 +10,14 @@ import subprocess
10
 
11
  import shutil
12
 
13
- '''if not shutil.which("esummary"):
14
- subprocess.run(
15
- 'yes | sh -c "$(wget -q https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh -O -)"',
16
- shell=True
17
- )
18
  os.environ["PATH"] += f":{os.environ['HOME']}/edirect"
19
- print("EDirect esummary found at:", shutil.which("esummary"))'''
 
 
 
20
 
21
  # Force PATH to include edirect (again, just to be safe)
22
  os.environ["PATH"] += f":{os.environ['HOME']}/edirect"
 
10
 
11
  import shutil
12
 
13
+ # Force reinstall every time (only if missing)
14
+ if not os.path.exists(f"{os.environ['HOME']}/edirect/esummary"):
15
+ subprocess.run("yes | sh -c \"$(wget -q https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh -O -)\"", shell=True)
 
 
16
  os.environ["PATH"] += f":{os.environ['HOME']}/edirect"
17
+ print("EDirect installed.")
18
+ else:
19
+ print("✅ EDirect already installed.")
20
+
21
 
22
  # Force PATH to include edirect (again, just to be safe)
23
  os.environ["PATH"] += f":{os.environ['HOME']}/edirect"