#!/bin/sh

REPO=https://github.com/KhronosGroup/Vulkan-Headers.git
VERSION=`dpkg-parsechangelog -S Version|sed 's/-.*//'`

# clean old checkout
git rm -rf vulkan-headers

git clone "$REPO" vulkan-headers
(
    cd vulkan-headers
    if git tag | grep -F "sdk-$VERSION"; then
        git reset --hard "sdk-$VERSION"
    else
        git reset --hard "v$VERSION"
    fi
)
rm -rf vulkan-headers/.git

git add -f vulkan-headers
git commit -m "Refresh vulkan-headers to $VERSION"
