From 2cacd9c142109cada46f720a5d3a337e16171c77 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 22 Oct 2020 21:59:29 +0200 Subject: [PATCH] Ask user before running makepkg on git repo --- src/util/install.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/util/install.py b/src/util/install.py index bac53b0..e47006c 100644 --- a/src/util/install.py +++ b/src/util/install.py @@ -2,7 +2,7 @@ import shutil import os from src.util import command -from src.util.user import Print +from src.util.user import Print, Input class Install: @@ -38,12 +38,11 @@ class Install: Print.comment(f"Git repository {dir_name} doesn't contain PKGBUILD, only downloaded.") return - cwd = os.getcwd() - print(cwd) - - os.chdir(dir_name) - - command.execute("makepkg -si") - - os.chdir(cwd) - shutil.rmtree(dir_name) + if Input.yes_no("Do you wish to run makepkg on the downloaded git repository?"): + cwd = os.getcwd() + os.chdir(dir_name) + command.execute("makepkg -si") + os.chdir(cwd) + shutil.rmtree(dir_name) + else: + command.execute(f"mv {dir_name} home/")