fix: add args input use --install from now onward
This commit is contained in:
parent
20f139fc76
commit
4f97e1efc3
|
@ -2,13 +2,21 @@ import filecmp
|
|||
import subprocess
|
||||
import os
|
||||
from time import sleep
|
||||
from server import weather_run
|
||||
|
||||
|
||||
def install():
|
||||
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)
|
||||
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()
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user