import json
from pathlib import Path
from builder.version import VERSION

UPDATE_DIR = Path.home() / "Desktop" / "ROM-Builder-Updates"

def check_for_update():
    version_file = UPDATE_DIR / "version.json"
    if not version_file.exists():
        return None
    with open(version_file) as f:
        info = json.load(f)
    if info["version"] > VERSION:
        return info
    return None
