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

@@ -3,6 +3,9 @@ import os
from pathlib import Path
import sys
from search_file import search_file
from swap_link import swap_link
def link_fixer(ln_path, tgt_dir_path):
ln_is_dir = False
@@ -32,6 +35,9 @@ def link_fixer(ln_path, tgt_dir_path):
print("Targets dir: \t", tgt_dir)
if ln_is_dir:
sys.exit("But ln dir version not yet implemented. Sorry!")
tgt = search_file(link.resolve().name, tgt_dir_path)
swap_link(ln_path, tgt)
def fix_link(lnk, tgt_dir_path):
return True