#!/bin/bash

# Stop on first non-zero exit code
set -e

pushd /opt/irontec/ivozprovider/schema
    # Regenerate all library files
    bin/run-generators -s Provider Ast Kam Cgr
    bin/run-service-update

    # Check there is no pending files to be commited
    if [ -n "$(git status -s)" ]; then
        echo "There are auto-generated changes not commited."
        git status -s
        exit 1
    fi
popd

