refactor: joining path not str
This commit is contained in:
parent
7bd485ffe6
commit
f1d6e154f9
|
@ -9,22 +9,22 @@ from pathlib import Path
|
||||||
def install(parsed) -> None:
|
def install(parsed) -> None:
|
||||||
args = parsed.parse_args()
|
args = parsed.parse_args()
|
||||||
if args.install:
|
if args.install:
|
||||||
projectDir = str(Path(__file__).resolve().parent.parent)
|
projectDir = Path(__file__).resolve().parent.parent
|
||||||
homeDir = os.getenv("HOME")
|
homeDir = os.getenv("HOME")
|
||||||
serviceDirExist = os.path.isdir(homeDir + "/.config/systemd/user/")
|
serviceDirExist = os.path.isdir(homeDir + "/.config/systemd/user/")
|
||||||
delivered = False
|
delivered = False
|
||||||
|
|
||||||
if serviceDirExist:
|
if serviceDirExist:
|
||||||
delivered = filecmp.cmp(
|
delivered = filecmp.cmp(
|
||||||
projectDir + "/services/wthrc.service",
|
os.path.join(projectDir, "services/wthrc.service"),
|
||||||
homeDir + "/.config/systemd/user/wthrc.service",
|
homeDir + "/.config/systemd/user/wthrc.service",
|
||||||
shallow=True,
|
shallow=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
if not delivered or not serviceDirExist:
|
if not delivered or not serviceDirExist:
|
||||||
os.environ["DIR"] = projectDir
|
os.environ["DIR"] = projectDir
|
||||||
subprocess.call(["sh", projectDir + "/scripts/install.sh"])
|
subprocess.call(["sh", os.path.join(projectDir, "scripts/install.sh")])
|
||||||
subprocess.call(["sh", projectDir + "/scripts/runner.sh"])
|
subprocess.call(["sh", os.path.join(projectDir, "scripts/runner.sh")])
|
||||||
|
|
||||||
sleep(5)
|
sleep(5)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user