worse is better lol

master
Jordan Orelli 2 years ago
parent 1a31fcc29d
commit c734aa1c2c

@ -77,19 +77,9 @@ class Installer:
target_path = pathlib.Path.home() / name target_path = pathlib.Path.home() / name
self.log.debug(" target: %s", target_path) self.log.debug(" target: %s", target_path)
if target_path.exists(): if target_path.exists():
self.log.debug(" target path exists") self.log.debug(" target path exists, will remove")
if target_path.is_symlink(): target_path.unlink()
self.log.debug(" is symlink") self.log.debug(" link: %s -> %s", target_path, source_path)
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) target_path.symlink_to(source_path)
if self.is_wsl: if self.is_wsl:
@ -98,6 +88,7 @@ class Installer:
if target_path.exists(): if target_path.exists():
self.log.debug(" target path exists, will remove") self.log.debug(" target path exists, will remove")
target_path.unlink() target_path.unlink()
self.log.debug(" copy: %s -> %s", source_path, target_path)
shutil.copy(source_path, target_path) shutil.copy(source_path, target_path)
@cached_property @cached_property

Loading…
Cancel
Save