1#!/bin/bash
2cd "$(dirname "$0")" || exit
3find . -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
4./regenerate-meson || exit
5rc=0
6git --no-pager diff --exit-code -- . || rc=$?
7untracked="$(git ls-files --others --exclude-standard -- .)" || rc=$?
8if [ -n "$untracked" ]; then
9  echo "Untracked files:" >&2
10  echo "$untracked" >&2
11  rc=1
12fi
13if (( rc != 0 )); then
14  echo "Generated meson files differ from expected values" >&2
15  exit 1
16fi
17