#!/bin/bash

# inspired by https://stackoverflow.com/questions/4632028

TMP_DIR=`mktemp -d`

if [[ ! "$TMP_DIR" || ! -d "$TMP_DIR" ]]; then
  echo "Could not create temp location to clone."
  exit 1
fi

function cleanup() {      
  rm -rf "$TMP_DIR"
}
trap cleanup EXIT

git clone -q https://bitbucket.org/thegmu/thegmu-pypi-template $TMP_DIR

rsync -a -r --ignore-existing --files-from=$TMP_DIR/bootstrap.txt $TMP_DIR .
