#!/usr/bin/env bash

DEST=${1:-/dev/skel}

# install cookiecutter
sudo apt install -y cookiecutter python3-cookiecutter

# install the collected cookiecutters
COOKIECUTTER_DIR=${DEST}/.cookiecutters
mkdir -p ${COOKIECUTTER_DIR}

# an array of urls to cookiecutters
urls=(
	https://github.com/cookiecutter/cookiecutter-django
	https://github.com/dunossauro/cookiecutter-behave
	https://github.com/lkubb/salt-tool-template-formula
	https://github.com/lkubb/salt-extension-cookiecutter
)

# pushd into the COOKIECUTTER_DIR and clone the urls with a depth of 1
pushd ${COOKIECUTTER_DIR}
for url in "${urls[@]}"; do
	git clone --depth 1 ${url}
done
popd
