fix: check for service directory existing.
This commit is contained in:
parent
7685ca2330
commit
7bd485ffe6
|
@ -5,9 +5,9 @@ DIR=$(dirname "$SCRIPT")
|
|||
|
||||
# Create dirrectory for systemd scripts
|
||||
cd $HOME/.config/
|
||||
mkdir systemd
|
||||
mkdir -p systemd
|
||||
cd systemd/
|
||||
mkdir user
|
||||
mkdir -p user
|
||||
|
||||
# Update daemon files
|
||||
cd "$DIR"
|
||||
|
|
|
@ -11,15 +11,21 @@ def install(parsed) -> None:
|
|||
if args.install:
|
||||
projectDir = str(Path(__file__).resolve().parent.parent)
|
||||
homeDir = os.getenv("HOME")
|
||||
delivered = filecmp.cmp(
|
||||
projectDir + "/services/wthrc.service",
|
||||
homeDir + "/.config/systemd/user/wthrc.service",
|
||||
shallow=True,
|
||||
)
|
||||
if not delivered:
|
||||
serviceDirExist = os.path.isdir(homeDir + "/.config/systemd/user/")
|
||||
delivered = False
|
||||
|
||||
if serviceDirExist:
|
||||
delivered = filecmp.cmp(
|
||||
projectDir + "/services/wthrc.service",
|
||||
homeDir + "/.config/systemd/user/wthrc.service",
|
||||
shallow=True,
|
||||
)
|
||||
|
||||
if not delivered or not serviceDirExist:
|
||||
os.environ["DIR"] = projectDir
|
||||
subprocess.call(["sh", projectDir + "/scripts/install.sh"])
|
||||
subprocess.call(["sh", projectDir + "/scripts/runner.sh"])
|
||||
|
||||
sleep(5)
|
||||
else:
|
||||
weather_run()
|
||||
|
|
Loading…
Reference in New Issue
Block a user