From ed33809680df5055b582ce3d61ca514a6f0db1c1 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@arch-desktop" Date: Mon, 8 Feb 2021 18:57:28 +0100 Subject: [PATCH] Completely remove first install flag --- install.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/install.py b/install.py index a8aaa03..a84882e 100755 --- a/install.py +++ b/install.py @@ -22,7 +22,6 @@ class Installer: def __init__( self, config: str, - first_install: bool = False, force: bool = False, hide_commands: bool = False, update: bool = False, @@ -32,7 +31,6 @@ class Installer: yaml = YAML(typ="safe") self.conf = yaml.load(Path(config).text()) self.force = force - self.first_install = first_install self.hide_commands = hide_commands self.home = Path("~").expanduser() self.operating_system = self.define_os() @@ -138,8 +136,6 @@ class Installer: "debian": self.operating_system == "debian", "force": self.force, "no force": not self.force, - "first install": self.first_install, - "no first install": not self.first_install, "update": self.update, "no update": not self.update, } @@ -394,7 +390,8 @@ class Installer: if not content.endswith("\n"): content += "\n" - p_dest.write_text(content, append=append) + if not p_dest.exists() or content not in p_dest.read_text(): + p_dest.write_text(content, append=append) def process(self, programs: Optional[List[str]] = None) -> None: """Install the programs provided. @@ -474,12 +471,6 @@ def main() -> None: "--config", help="Use CONFIG file (default: 'configs.yml')", ) - parser.add_argument( - "-i", - "--first_install", - action="store_true", - help="Assume the program is not installed", - ) parser.add_argument( "-f", "--force", @@ -526,7 +517,6 @@ def main() -> None: else: config = "configs.yml" - first_install = args.first_install force = args.force generate = args.generate hide_commands = args.hide_commands @@ -536,7 +526,6 @@ def main() -> None: installer = Installer( config=config, - first_install=first_install, force=force, hide_commands=hide_commands, update=update,