1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 11:01:45 +00:00

Fix pivot path on Windows

This was causing a compare of template files to remove the existing
dotfiles at the destinations.
This commit is contained in:
Mo Hyun
2024-10-23 12:12:33 -07:00
committed by deadc0de
parent c51ac6f968
commit d5d00ef9c0

View File

@@ -654,7 +654,10 @@ def pivot_path(path, newdir, striphome=False, logger=None):
logger.dbg(f'strip home: {striphome}')
if striphome:
path = strip_home(path)
sub = path.lstrip(os.sep)
# Account for Windows paths
sub = path.lstrip(PurePath(path).anchor)
new = os.path.join(newdir, sub)
if logger:
logger.dbg(f'pivot \"{path}\" to \"{new}\"')