Remove ' based' in os
This commit is contained in:
parent
fe481b0f0a
commit
676f58ae0d
1 changed files with 18 additions and 21 deletions
39
install.py
39
install.py
|
@ -51,29 +51,26 @@ class Installer:
|
|||
ui.info_3("Found", operating_system)
|
||||
|
||||
if operating_system in ("arch", "manjaro"):
|
||||
subprocess.run(
|
||||
"sudo pacman -Syu",
|
||||
check=True,
|
||||
shell=True,
|
||||
stdout=this_stdout,
|
||||
stderr=this_stderr,
|
||||
)
|
||||
return "arch based"
|
||||
command = "sudo pacman -Syu"
|
||||
operating_system = "arch"
|
||||
|
||||
if operating_system in ("debian", "ubuntu"):
|
||||
subprocess.run(
|
||||
"sudo apt update",
|
||||
check=True,
|
||||
shell=True,
|
||||
stdout=this_stdout,
|
||||
stderr=this_stderr,
|
||||
)
|
||||
return "debian based"
|
||||
command = "sudo apt update"
|
||||
operating_system = "debian"
|
||||
|
||||
subprocess.run(
|
||||
command,
|
||||
check=True,
|
||||
shell=True,
|
||||
stdout=this_stdout,
|
||||
stderr=this_stderr,
|
||||
)
|
||||
return operating_system
|
||||
|
||||
ui.warning("Operating system wasn't found")
|
||||
operating_system = input("What is it ? ")
|
||||
if operating_system in ("arch", "debian"):
|
||||
return operating_system + " based"
|
||||
return operating_system
|
||||
|
||||
ui.fatal("I only support Arch and Debian based distros.")
|
||||
|
||||
|
@ -83,8 +80,8 @@ class Installer:
|
|||
"""Run a bash command. On success return True, else return False."""
|
||||
|
||||
conditions = {
|
||||
"arch": self.operating_system == "arch based",
|
||||
"debian": self.operating_system == "debian based",
|
||||
"arch": self.operating_system == "arch",
|
||||
"debian": self.operating_system == "debian",
|
||||
"force": self.force,
|
||||
"no force": not self.force,
|
||||
"first install": self.first_install,
|
||||
|
@ -207,9 +204,9 @@ class Installer:
|
|||
|
||||
ui.info_2("Installing packages...")
|
||||
for i, package in enumerate(packages):
|
||||
if self.operating_system == "arch based":
|
||||
if self.operating_system == "arch":
|
||||
command = "sudo pacman -S --needed --noconfirm {}".format(package)
|
||||
elif self.operating_system == "debian based":
|
||||
elif self.operating_system == "debian":
|
||||
command = "sudo apt install -y {}".format(package)
|
||||
|
||||
ui.info_count(i, len(packages), package, end="... ")
|
||||
|
|
Loading…
Add table
Reference in a new issue