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

set -eu

if [ ! -d ./airflow ]; then
  git clone https://github.com/jdx/airflow ./airflow
fi
cd ./airflow
git checkout hk
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
