#!/usr/bin/env python3

import os
import subprocess

asset_path = "Assets/ofb-assets"

for root, dirs, files in os.walk(asset_path):
    for file in files:
        if file.endswith("aseprite"):
            new_file = file.rstrip("aseprite") + "png"
            print(f"Compiling {root}/{file} to {root}/{new_file}")
            subprocess.run(
                [
                    "aseprite",
                    f"{root}/{file}",
                    "-b",
                    "--sheet",
                    f"{root}/{new_file}",
                    "--sheet-type",
                    "horizontal",
                ]
            )
