mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-16 05:49:59 -05:00
fix: use tempdir for aur helper install
This commit is contained in:
@@ -17,7 +17,7 @@ def _install_aur_helper(helper: str, noconfirm: bool = False) -> None:
|
|||||||
subprocess.run(pacman_cmd, check=True)
|
subprocess.run(pacman_cmd, check=True)
|
||||||
|
|
||||||
repo_url = f"https://aur.archlinux.org/{helper}.git"
|
repo_url = f"https://aur.archlinux.org/{helper}.git"
|
||||||
repo_dir = f"/tmp/{helper}"
|
with tempfile.TemporaryDirectory() as repo_dir:
|
||||||
subprocess.run(["git", "clone", repo_url, repo_dir], check=True)
|
subprocess.run(["git", "clone", repo_url, repo_dir], check=True)
|
||||||
|
|
||||||
makepkg_cmd = ["makepkg", "-si"]
|
makepkg_cmd = ["makepkg", "-si"]
|
||||||
@@ -25,11 +25,6 @@ def _install_aur_helper(helper: str, noconfirm: bool = False) -> None:
|
|||||||
makepkg_cmd.append("--noconfirm")
|
makepkg_cmd.append("--noconfirm")
|
||||||
subprocess.run(makepkg_cmd, cwd=repo_dir, check=True)
|
subprocess.run(makepkg_cmd, cwd=repo_dir, check=True)
|
||||||
|
|
||||||
try:
|
|
||||||
shutil.rmtree(repo_dir)
|
|
||||||
except FileNotFoundError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if helper == "yay":
|
if helper == "yay":
|
||||||
subprocess.run(["yay", "-Y", "--gendb"], check=True)
|
subprocess.run(["yay", "-Y", "--gendb"], check=True)
|
||||||
subprocess.run(["yay", "-Y", "--devel", "--save"], check=True)
|
subprocess.run(["yay", "-Y", "--devel", "--save"], check=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user