can execute files and install packages
This commit is contained in:
parent
230cf99f06
commit
f611ef603b
3 changed files with 42 additions and 2 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue