withopen(file_path, "w") as file: json.dump(data, file, indent=2) # print(f"Updated file: {file_path}") except json.JSONDecodeError as e: print(f"Error parsing JSON in file {file_path}: {e}") except Exception as e: print(f"Error updating file {file_path}: {e}")
defupdate_meta_file_2(file_path): try: print(f"Processing file: {file_path}") withopen(file_path, "r") as file: data = json.load(file) data["platformSettings"] = {}
withopen(file_path, "w") as file: json.dump(data, file, indent=2) # print(f"Updated file: {file_path}") except json.JSONDecodeError as e: print(f"Error parsing JSON in file {file_path}: {e}") except Exception as e: print(f"Error updating file {file_path}: {e}")
defrecursive_update(directory): for root, _, files in os.walk(directory): for file in files: if file.endswith(".png.meta") or file.endswith(".jpg.meta"): file_path = os.path.join(root, file) update_meta_file(file_path)
defrecursive_update_2(directory): for root, _, files in os.walk(directory): for file in files: if file.endswith(".png.meta") or file.endswith(".jpg.meta"): file_path = os.path.join(root, file) update_meta_file_2(file_path)