From e7747d48a2b9d5f172be9e7102c3ac5e9d22f9dd Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Fri, 12 Dec 2025 15:39:20 -0500 Subject: PROJECT 04 --- scripts/check-tree.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/check-tree.py b/scripts/check-tree.py index e37110a..8a4b010 100755 --- a/scripts/check-tree.py +++ b/scripts/check-tree.py @@ -60,8 +60,8 @@ with open(sys.argv[2], 'r', encoding='utf-8') as f: continue if listed_disabled and side not in ('r', 'd'): filename += '.disabled' - all_files.append(filename) target = f'{tree}/{mod_paths[side]}/{filename}' + all_files.append(target) if not os.path.isfile(target): print(f'err: Mod not found in the specified directory.\n\t{target}') any_error = True @@ -87,18 +87,19 @@ with open(sys.argv[3], 'r', encoding='utf-8') as f: side, path = parse_line(line, config_paths) if not side: continue - all_files.append(path.split('/')[-1]) target = f'{tree}/{config_paths[side]}/{path}' + all_files.append(target) if not os.path.isfile(target): print(f'err: Config file not found in specified directory.\n\t{target}') any_error = True for subdir, dirs, files in os.walk(tree): for file in files: - if not (subdir.endswith('mods') or subdir.endswith('resourcepacks') or subdir.endswith('datapacks')): + path = os.path.join(subdir, file) + if path == 'tree/modrinth.index.json': continue - if file not in all_files: - print(f'err: Erroneous file in tree.\n\t{os.path.join(subdir, file)}') + if path not in all_files: + print(f'err: Erroneous file in tree.\n\t{path}') any_error = True if not any_error: -- cgit v1.2.3-101-g0448