#!/bin/bash
# Copyright 2016 Alf Gaida <agaida@siduction.org>
# License: WTFPL-2

source VERSION

[ -d ./debtemplate ] && rm -rf debtemplate

git checkout templates -- bootstrap
git checkout templates -- debtemplate
git checkout templates -- functions.sh
git checkout templates -- template

[ -f ./debian/rules ] && ./bootstrap && echo 'Bootstrap first run ...'
[ ! -f ./debian/rules ] && ./bootstrap && echo 'Bootstrap second run ...'

[ -f ./debian/rules ] && rm -f bootstrap
[ -f ./debian/rules ] && rm -rf debtemplate
[ -f ./debian/rules ] && rm -f functions.sh
[ -f ./debian/rules ] && rm -rf template


[ ! -f ./debian/rules ] && echo 'Something went wrong, debian/rules not created! Check bootstrap!'

git add .
