Skip to content

Commit

Permalink
Fix pivot path on Windows
Browse files Browse the repository at this point in the history
This was causing a compare of template files to remove the existing
dotfiles at the destinations.
  • Loading branch information
shyun3 authored and deadc0de6 committed Oct 24, 2024
1 parent c51ac6f commit d5d00ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dotdrop/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}\"')
Expand Down

0 comments on commit d5d00ef

Please sign in to comment.