-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.py
32 lines (26 loc) · 991 Bytes
/
install.py
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
27
28
29
30
31
32
import subprocess
def log_and_run(commands, description, cwd=None):
from colorama import Fore, Style
full_command = " && ".join(commands)
try:
print(f"{Fore.YELLOW}Starting: {description}...{Style.RESET_ALL}")
print(f"{Fore.CYAN}Command: {full_command}{Style.RESET_ALL}")
result = subprocess.run(
full_command, shell=True, check=True, cwd=cwd, text=True
)
print(f"{Fore.GREEN}Success: {description} completed!\n{Style.RESET_ALL}")
except subprocess.CalledProcessError as e:
print(
f"{Fore.RED}Error running command '{full_command}': {e}\n{Style.RESET_ALL}"
)
if __name__ == "__main__":
subprocess.run("pip install colorama", shell=True, check=True, text=True)
log_and_run(
[
"pip install cairo-lang-0.13.1.zip",
"pip install aiofiles",
"pip install cairo0-bootloader/",
],
"Installing cairo-lang",
cwd=".",
)