1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 14:31:46 +00:00

refactoring

This commit is contained in:
deadc0de6
2022-05-28 23:35:01 +02:00
committed by deadc0de
parent a547f0f72b
commit 472c4ae275

View File

@@ -460,20 +460,16 @@ class Installer:
return False, err
# create symlink
if absolute:
# absolute symlink pointing to src named dst
os.symlink(src, dst)
if not self.comparing:
self.log.sub('linked {} to {}'.format(dst, src))
else:
lnk_src = src
if not absolute:
# relative symlink
dstrel = dst
if not os.path.isdir(dstrel):
dstrel = os.path.dirname(dstrel)
rel = os.path.relpath(src, dstrel)
os.symlink(rel, dst)
if not self.comparing:
self.log.sub('linked {} to {}'.format(dst, rel))
lnk_src = os.path.relpath(src, dstrel)
os.symlink(lnk_src, dst)
if not self.comparing:
self.log.sub('linked {} to {}'.format(dst, lnk_src))
return True, None
def _copy_file(self, templater, src, dst,