#!/usr/bin/env bash
#MISE depends=["build"]

set -eu

if [ ! -d ./pillow ]; then
  git clone https://github.com/jdx/Pillow ./pillow
fi
cd ./pillow
git checkout main
git pull
hk migrate pre-commit --hk-pkl-root ../pkl --force
if [ -n "$(git status --porcelain hk.pkl)" ]; then
  git add hk.pkl
  git -c commit.gpgsign=false commit -m "chore: regenerate hk.pkl"
fi
hk check --all
