Browse Source

Move existing source paths to backup even if symlink

pull/10/head
Ryan Reed 1 year ago
parent
commit
62012bfacf
1 changed files with 3 additions and 7 deletions
  1. +3
    -7
      src/transpose/transpose.py

+ 3
- 7
src/transpose/transpose.py View File

@ -8,7 +8,7 @@ import json
from . import version as transpose_version
from .exceptions import TransposeError
from .utils import move, remove, symlink
from .utils import move, symlink
@dataclass
@ -162,9 +162,7 @@ class Transpose:
entry_path = Path(self.config.entries[name].path)
if entry_path.exists():
if entry_path.is_symlink():
remove(entry_path)
elif force: # Backup the existing path
if force: # Backup the existing path
move(entry_path, entry_path.with_suffix(".backup"))
else:
raise TransposeError(
@ -192,9 +190,7 @@ class Transpose:
entry_path = Path(self.config.entries[name].path)
if entry_path.exists():
if entry_path.is_symlink():
remove(entry_path)
elif force: # Backup the existing path
if force: # Backup the existing path
move(entry_path, entry_path.with_suffix(".backup"))
else:
raise TransposeError(


Loading…
Cancel
Save