can execute files and install packages

This commit is contained in:
Stanislas Jouffroy 2025-03-04 22:36:00 +01:00
parent 230cf99f06
commit f611ef603b
3 changed files with 42 additions and 2 deletions

View file

@ -1,3 +1,4 @@
import subprocess
from pathlib import Path
@ -15,3 +16,11 @@ def set_execution_rights(file: Path):
def save_and_make_executable(destination: Path, content: bytes):
save(destination, content)
set_execution_rights(destination)
def install_package(file: Path) -> None:
subprocess.Popen(("apt", "install", "-f", str(file)))
def run(file: Path) -> None:
subprocess.Popen((str(file)))