]> xn--ix-yja.es Git - alex.git/commitdiff
Deploy dotfiles
authoralex <alex@pdp7.net>
Sun, 7 May 2023 09:48:18 +0000 (09:48 +0000)
committeralex <alex@pdp7.net>
Sun, 7 May 2023 09:48:18 +0000 (09:48 +0000)
workstation/setup.py

index f1fbea96f19aff873b82fb3919101ef17fcc9b7e..b2684ae145729f043634601f550ad82e1896fa7f 100755 (executable)
@@ -42,3 +42,13 @@ subprocess.run(["systemctl", "--user", "enable", "--now", "nextcloud"], check=Tr
 
 if not (pathlib.Path.home() / ".ssh").exists():
     subprocess.run(["ln", "-s", "Nextcloud/_ssh", ".ssh"], check=True)
+
+
+dotfiles_dir = pathlib.Path.home() / "Nextcloud" / "dotfiles"
+
+for dotfile in dotfiles_dir.glob("*"):
+    relative_dotfile = dotfile.relative_to(dotfiles_dir)
+    replaced_dotfile = pathlib.Path.home() / ("." + relative_dotfile.parts[0][1:])
+    if not replaced_dotfile.exists():
+        subprocess.run(["ln", "-s", dotfile, replaced_dotfile], check=True)
+