Remap: Refactor scripts #177

Merged
Nick Alberelli merged 17 commits from :feature/refactor-remap-script into main 2023-12-07 16:17:27 +01:00
Showing only changes of commit 226aa801b7 - Show all commits

View File

@ -9,9 +9,9 @@ file_updated = False
json_file_path = "" # File Path to read/write JSON File to
gold_file_map_json = Path(json_file_path)
gold_file_map_data = open(gold_file_map_json)
gold_file_map_dict = json.load(gold_file_map_data)
file_map_json = Path(json_file_path)
file_map_data = open(file_map_json)
file_map_dict = json.load(file_map_data)
@contextlib.contextmanager
@ -56,12 +56,12 @@ def generate_checksum(filepath: str) -> str:
def find_new_from_old(old_path):
for _, value in gold_file_map_dict.items():
for _, value in file_map_dict.items():
for old_json_path in value['old']:
if old_json_path.endswith(old_path.split("/..")[-1]):
if value['new'] != old_json_path:
return value['new']
for _, value in gold_file_map_dict.items():
for _, value in file_map_dict.items():
for old_json_path in value['old']:
if old_json_path.endswith(old_path.split("/")[-1]):
if value['new'] != old_json_path: