link_fixer for single file now works!

This commit is contained in:
2024-07-24 21:25:38 -04:00
parent 82b4963bb0
commit aea33d4fac
3 changed files with 9 additions and 3 deletions

View File

@@ -6,8 +6,8 @@ from pathlib import Path
from os.path import relpath # won't be necessary with Python 3.12 thanks to walk_up arg in relative_to()
def swap_link(lnk, tgt):
#lnk: symbolic link to swap
#tgt: target for new link
#lnk: symbolic link to swap, str
#tgt: target for new link, str
lnpath = Path(lnk)
if not lnpath.is_symlink():
raise Exception("First argument is not a symbolic link")