diff --git a/src/installer.py b/src/installer.py index 6d854e5..2f2b231 100644 --- a/src/installer.py +++ b/src/installer.py @@ -10,19 +10,19 @@ def install(parsed) -> None: args = parsed.parse_args() if args.install: projectDir = Path(__file__).resolve().parent.parent - homeDir = os.getenv("HOME") - serviceDirExist = os.path.isdir(homeDir + "/.config/systemd/user/") + homeDir = Path(os.getenv("HOME")) + serviceDirExist = os.path.isdir(os.path.join(homeDir, ".config/systemd/user/")) delivered = False if serviceDirExist: delivered = filecmp.cmp( os.path.join(projectDir, "services/wthrc.service"), - homeDir + "/.config/systemd/user/wthrc.service", + os.path.join(homeDir, ".config/systemd/user/wthrc.service"), shallow=True, ) if not delivered or not serviceDirExist: - os.environ["DIR"] = projectDir + os.environ["DIR"] = str(projectDir) subprocess.call(["sh", os.path.join(projectDir, "scripts/install.sh")]) subprocess.call(["sh", os.path.join(projectDir, "scripts/runner.sh")]) diff --git a/src/main.py b/src/main.py index 469be30..4bdeca3 100644 --- a/src/main.py +++ b/src/main.py @@ -1,7 +1,7 @@ from installer import install import argparse -parsed = argparse.ArgumentParser() -parsed.add_argument("--install", "-i", action="store_true") +flags = argparse.ArgumentParser() +flags.add_argument("--install", "-i", action="store_true") -install(parsed) +install(flags)