set -eu
remote_url="$(git remote get-url origin 2>/dev/null || true)"
if ! command -v sce >/dev/null 2>&1; then
echo "sce CLI not found. Install it from https://sce.crocoder.dev/docs/getting-started#install-cli" >&2
exit 0
fi
if [ -n "$remote_url" ]; then
exec sce hooks post-commit --vcs git --remote-url "$remote_url" "$@"
fi
exec sce hooks post-commit --vcs git "$@"