]> xn--ix-yja.es Git - alex.git/commitdiff
Make more idempotent
authoralex <alex@pdp7.net>
Tue, 21 May 2024 11:09:15 +0000 (13:09 +0200)
committeralex <alex@pdp7.net>
Tue, 21 May 2024 11:09:15 +0000 (13:09 +0200)
scripts/p7s/emacs.py

index c27001f2904fb35f87470d196d34b38b4bd80c81..9eba95f93f964e97abfd35418cb991cc40df2116 100644 (file)
@@ -5,7 +5,7 @@ import p7s
 
 def setup_emacs():
     p7s.BASHRC_D.mkdir(parents=True, exist_ok=True)
-    (p7s.BASHRC_D / "emacs.bash").unlink()
+    (p7s.BASHRC_D / "emacs.bash").unlink(missing_ok=True)
     subprocess.run(["ln", "-s", (pathlib.Path(__file__).parent.parent.parent / "emacs" / "emacs.bash").absolute(), p7s.BASHRC_D / "emacs.bash"], check=True)
-    (pathlib.Path.home() / ".emacs").unlink()
+    (pathlib.Path.home() / ".emacs").unlink(missing_ok=True)
     subprocess.run(["ln", "-s", (pathlib.Path(__file__).parent.parent.parent / "emacs" / "emacs.el").absolute(), pathlib.Path.home() / ".emacs"], check=True)