#!/bin/bash
set -e

git clone https://github.com/dchevell/flask-executor opengnsys-flask-executor
cd opengnsys-flask-executor
version=`python3 ./setup.py --version`
cd ..

if [ -d "opengnsys-flask-executor-${version}" ] ; then
	echo "Directory opengnsys-flask-executor-${version} already exists, won't overwrite"
	exit 1
else
	rm -rf opengnsys-flask-executor/.git
	mv opengnsys-flask-executor "opengnsys-flask-executor-${version}"
	tar -c --xz -v -f "opengnsys-flask-executor_${version}.orig.tar.xz" "opengnsys-flask-executor-${version}"
fi

