From 28780a3d0efb8307f4343c03835d1aae94dc90d7 Mon Sep 17 00:00:00 2001 From: c-c-k Date: Wed, 19 Jul 2023 19:27:02 +0300 Subject: [PATCH] Add backup_root to Link._process_links --- dotbot/plugins/link.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dotbot/plugins/link.py b/dotbot/plugins/link.py index adfc0bc..66e38ec 100644 --- a/dotbot/plugins/link.py +++ b/dotbot/plugins/link.py @@ -33,6 +33,7 @@ class Link(Plugin): canonical_path = defaults.get("canonicalize", defaults.get("canonicalize-path", True)) force = defaults.get("force", False) relink = defaults.get("relink", False) + backup_root = defaults.get("backup-root", None) create = defaults.get("create", False) use_glob = defaults.get("glob", False) base_prefix = defaults.get("prefix", "") @@ -48,6 +49,7 @@ class Link(Plugin): ) force = source.get("force", force) relink = source.get("relink", relink) + backup_root = source.get("backup-root", backup_root) create = source.get("create", create) use_glob = source.get("glob", use_glob) base_prefix = source.get("prefix", base_prefix) @@ -85,6 +87,7 @@ class Link(Plugin): relative, canonical_path, force, + backup_root, ) success &= self._link( glob_full_item, @@ -107,7 +110,9 @@ class Link(Plugin): self._log.warning("Nonexistent source %s -> %s" % (destination, path)) continue if force or relink: - success &= self._delete(path, destination, relative, canonical_path, force) + success &= self._delete( + path, destination, relative, canonical_path, force, backup_root + ) success &= self._link(path, destination, relative, canonical_path, ignore_missing) if success: self._log.info("All links have been set up")