OOP: Installation Checks

This commit is contained in:
koumakpet 2020-04-04 00:55:21 +02:00
parent 61c44e1a76
commit bab2696bac
3 changed files with 100 additions and 4 deletions

View file

@ -5,6 +5,10 @@ import shutil
from util import Command, Input, Print, Path
class InstallationError(Exception):
pass
def _generate_install_text(install_text, package_name, yay=False, git=False):
if install_text == 'default':
install_text = f'Do you wish to install {package_name}?'

View file

@ -22,10 +22,10 @@ def check_dir_exists(paths):
for dir_path in paths:
dir_path = os.path.expanduser(dir_path)
if os.path.isdir(dir_path):
return True
return True, dir_path
break
else:
return False
return False, None
def check_file_exists(paths):