]> xn--ix-yja.es Git - alex.git/commitdiff
Fix relative paths
authoralex <alex@pdp7.net>
Sun, 7 May 2023 09:47:31 +0000 (09:47 +0000)
committeralex <alex@pdp7.net>
Sun, 7 May 2023 09:47:31 +0000 (09:47 +0000)
workstation/setup.py

index 5d64a10169bed6d2f339abdb7e0476de292685cf..f1fbea96f19aff873b82fb3919101ef17fcc9b7e 100755 (executable)
@@ -12,7 +12,7 @@ def _(t):
 print("Installing some packages...")
 subprocess.run(["sudo", "dnf", "install", "-y", "rclone", "fuse", "git"], check=True)
 
-if not pathlib.Path(".config/rclone/rclone.conf").exists():
+if not (pathlib.Path.home() / ".config" / "rclone" / "rclone.conf").exists():
     print(_("""
         Visit https://nextcloud.pdp7.net/nextcloud/index.php/settings/user/security , create an app password
     """))
@@ -23,7 +23,7 @@ if not pathlib.Path(".config/rclone/rclone.conf").exists():
 pathlib.Path("Nextcloud").mkdir(exist_ok=True)
 
 
-nextcloud_service_path = pathlib.Path(".config/systemd/user/nextcloud.service")
+nextcloud_service_path = pathlib.Path.home() / ".config" / "systemd" / "user" / "nextcloud.service"
 nextcloud_service_path.parent.mkdir(parents=True, exist_ok=True)
 
 
@@ -40,5 +40,5 @@ with open(nextcloud_service_path, "w", encoding="utf8") as f:
 
 subprocess.run(["systemctl", "--user", "enable", "--now", "nextcloud"], check=True)
 
-if not pathlib.Path(".ssh").exists():
+if not (pathlib.Path.home() / ".ssh").exists():
     subprocess.run(["ln", "-s", "Nextcloud/_ssh", ".ssh"], check=True)