diff --git a/src/installer.py b/src/installer.py index 27fe690..97fceb1 100644 --- a/src/installer.py +++ b/src/installer.py @@ -2,13 +2,21 @@ import filecmp import subprocess import os from time import sleep +from server import weather_run -def install(): - projectDir="/home/citrullux/ModernOSLabs" - delivered=filecmp.cmp(projectDir+"/services/wthrc.service", "/home/citrullux/.config/systemd/user/wthrc.service", shallow=True) - if not delivered: - os.environ["DIR"]=projectDir - subprocess.call(["/usr/bin/sh", projectDir+"/scripts/install.sh"]) - subprocess.call(["/usr/bin/sh", projectDir+"/scripts/runner.sh"]) - sleep(5) +def install(parsed): + args = parsed.parse_args() + if args.install: + projectDir = "/home/citrullux/ModernOSLabs" + delivered = filecmp.cmp( + projectDir + "/services/wthrc.service", + "/home/citrullux/.config/systemd/user/wthrc.service", + shallow=True, + ) + if not delivered: + os.environ["DIR"] = projectDir + subprocess.call(["/usr/bin/sh", projectDir + "/scripts/install.sh"]) + subprocess.call(["/usr/bin/sh", projectDir + "/scripts/runner.sh"]) + sleep(5) + weather_run() diff --git a/src/main.py b/src/main.py index 9c79418..469be30 100644 --- a/src/main.py +++ b/src/main.py @@ -1,5 +1,7 @@ -from server import weather_run from installer import install +import argparse -install() -weather_run() +parsed = argparse.ArgumentParser() +parsed.add_argument("--install", "-i", action="store_true") + +install(parsed)