#!/bin/bash

resolver=../../tools/resolver/resolver
[[ -x $resolver ]] || ya make -r --checkout "$(dirname $resolver)" || exit $?

for f in ${@:-*.yaml}; do
    echo "$f..."
    cp "$f" "$f.old"
    $resolver --update "$f.old" < "in/$f" > "$f"
    rm "$f.old"
done
