Ask for symlink overwrite, add pacman -Syu at OS determination

This commit is contained in:
flyingscorpio@arch-desktop 2020-08-26 11:14:22 +02:00
parent 81a7c0d39c
commit 07a694bbf4

View file

@ -234,8 +234,11 @@ class Installer:
p_dest.parent.makedirs_p()
if p_dest.exists() and not self.force:
ui.info_2("Skipping", pretty_dest)
return
if not ui.ask_yes_no(f"{pretty_dest} already exists. Overwrite?"):
ui.info_2("Skipping", pretty_dest)
return
ui.info_2("Deleting", pretty_dest)
p_dest.remove()
if p_dest.islink():
p_dest.remove()
@ -333,6 +336,12 @@ def define_os() -> str:
ui.info_3("Found", operating_system)
if operating_system in ("arch", "manjaro"):
subprocess.run(
"sudo pacman -Syu",
check=True,
shell=True,
stdout=subprocess.DEVNULL,
)
return "arch based"
if operating_system in ("debian", "ubuntu"):