diff --git a/.gitignore b/.gitignore index 698a2e4a..b5fbe790 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ temp.* temp-read-ids.txt allCharacters.txt combined.js -data/patches # Excluded files *.DS_Store diff --git a/tools/merge_out.py b/tools/merge_out.py index 743aedb5..52b38fb0 100644 --- a/tools/merge_out.py +++ b/tools/merge_out.py @@ -27,6 +27,7 @@ last_id = int(id) patches_dir = "../data/patches/" +permanent_patch_file = "temp-atlas.json" if not os.path.exists(patches_dir): print("Patches folder not found. Exiting.") exit() @@ -34,8 +35,14 @@ base_image_path = os.path.join('..', 'web', '_img', 'canvas', 'place30') ScaleConfig.image1 = os.path.join(base_image_path, '159.png') -for filename in os.listdir(patches_dir): - f = os.path.join(patches_dir, filename) +filenames = os.listdir(patches_dir) +filenames.append(permanent_patch_file) + +for filename in filenames: + if filename == permanent_patch_file: + f = filename + else: + f = os.path.join(patches_dir, filename) print(f"{filename}: Processing...") @@ -93,6 +100,9 @@ print(f"{filename}: Added {entry['id']}.") atlas_data.append(entry) + if filename != permanent_patch_file: + os.remove(f) + except: print(f"{filename}: Something went wrong; patch couldn't be implemented. Skipping.") traceback.print_exc()