From c734aa1c2c0b8a625e469818c34c93fe71c7bcca Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Fri, 6 Jan 2023 22:09:58 -0600 Subject: [PATCH] worse is better lol --- installer.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/installer.py b/installer.py index 3bf709c..b391d7c 100644 --- a/installer.py +++ b/installer.py @@ -77,20 +77,10 @@ class Installer: target_path = pathlib.Path.home() / name self.log.debug(" target: %s", target_path) if target_path.exists(): - self.log.debug(" target path exists") - if target_path.is_symlink(): - self.log.debug(" is symlink") - if target_path.resolve() == source_path: - self.log.debug(" up to date") - else: - self.log.info("%s -> %s", target_path, source_path) - target_path.symlink_to(source_path) - else: - self.log.info("%s -> %s", target_path, source_path) - target_path.symlink_to(source_path) - else: - self.log.info("%s -> %s", target_path, source_path) - target_path.symlink_to(source_path) + self.log.debug(" target path exists, will remove") + target_path.unlink() + self.log.debug(" link: %s -> %s", target_path, source_path) + target_path.symlink_to(source_path) if self.is_wsl: target_path = self.windows_home_dir / pathlib.PureWindowsPath(name) @@ -98,6 +88,7 @@ class Installer: if target_path.exists(): self.log.debug(" target path exists, will remove") target_path.unlink() + self.log.debug(" copy: %s -> %s", source_path, target_path) shutil.copy(source_path, target_path) @cached_property