#!/usr/bin/env bash
# Regenerate the Xcode project after anything that can change project.yml.
#
# `FlamenetMessenger.xcodeproj` is generated by xcodegen and is not in git, so
# a pull updates project.yml and leaves the project Xcode opens exactly as it
# was. That is how a stale version number gets archived: everything on disk is
# correct and the one file Xcode reads is a day old.
#
# Installed by Scripts/generate.sh, which sets core.hooksPath to this
# directory. Silent when nothing changed.
set -u
cd "$(git rev-parse --show-toplevel)" || exit 0
[ -f project.yml ] || exit 0
./Scripts/generate.sh >/dev/null 2>&1 && echo "xcodegen: project regenerated"
exit 0
