|
@ -10,7 +10,6 @@ class Transpose: |
|
|
target_path: str, |
|
|
target_path: str, |
|
|
store_path: str, |
|
|
store_path: str, |
|
|
cache_filename: str = None, |
|
|
cache_filename: str = None, |
|
|
force: bool = False, |
|
|
|
|
|
) -> None: |
|
|
) -> None: |
|
|
self.target_path = Path(target_path) |
|
|
self.target_path = Path(target_path) |
|
|
self.store_path = Path(store_path) |
|
|
self.store_path = Path(store_path) |
|
@ -20,8 +19,6 @@ class Transpose: |
|
|
self.cache_filename = cache_filename |
|
|
self.cache_filename = cache_filename |
|
|
self.cache_path = Path(self.target_path).joinpath(cache_filename) |
|
|
self.cache_path = Path(self.target_path).joinpath(cache_filename) |
|
|
|
|
|
|
|
|
self.force = force |
|
|
|
|
|
|
|
|
|
|
|
def apply(self) -> None: |
|
|
def apply(self) -> None: |
|
|
""" |
|
|
""" |
|
|
Recreate the symlink from an existing cache file |
|
|
Recreate the symlink from an existing cache file |
|
@ -60,9 +57,6 @@ class Transpose: |
|
|
f"Original path in cache file already exists: {original_path}" |
|
|
f"Original path in cache file already exists: {original_path}" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
if not original_path.parent.exists() and self.force: |
|
|
|
|
|
original_path.parent.mkdir(parents=True) |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
move(source=self.target_path, destination=original_path) |
|
|
move(source=self.target_path, destination=original_path) |
|
|
except FileNotFoundError: |
|
|
except FileNotFoundError: |
|
|