#!/bin/bash

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

TMP_DIR=`mktemp -d`

if [[ ! "$TMP_DIR" || ! -d "$TMP_DIR" ]]; then
  echo "Could not temp location to clone PyPi Template :-("
  exit 1
fi

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

git clone -q https://github.com/christophevg/pypi-template $TMP_DIR

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