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 subprocess
|
||||||
import os
|
import os
|
||||||
from time import sleep
|
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"
|
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:
|
if not delivered:
|
||||||
os.environ["DIR"] = projectDir
|
os.environ["DIR"] = projectDir
|
||||||
subprocess.call(["/usr/bin/sh", projectDir + "/scripts/install.sh"])
|
subprocess.call(["/usr/bin/sh", projectDir + "/scripts/install.sh"])
|
||||||
subprocess.call(["/usr/bin/sh", projectDir + "/scripts/runner.sh"])
|
subprocess.call(["/usr/bin/sh", projectDir + "/scripts/runner.sh"])
|
||||||
sleep(5)
|
sleep(5)
|
||||||
|
weather_run()
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
from server import weather_run
|
|
||||||
from installer import install
|
from installer import install
|
||||||
|
import argparse
|
||||||
|
|
||||||
install()
|
parsed = argparse.ArgumentParser()
|
||||||
weather_run()
|
parsed.add_argument("--install", "-i", action="store_true")
|
||||||
|
|
||||||
|
install(parsed)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user