#!/usr/bin/env bash
#

# Make sure our data directory is setup
mkdir -p ./data

# Check if Country List downloaded or not
if [ -d ./country-list ]; then
	cd country-list
	git pull
	cd ..
else
	git clone https://github.com/umpirsky/country-list.git
fi

# Check if Currency List downloaded or not
if [ -d ./currency-list ]; then
        cd currency-list
        git pull
        cd ..
else
        git clone https://github.com/umpirsky/currency-list.git
fi

# Check if Language List downloaded or not
if [ -d ./language-list ]; then
        cd language-list
        git pull
        cd ..
else
        git clone https://github.com/umpirsky/language-list.git
fi

# Check if Locale List downloaded or not
if [ -d ./locale-list ]; then
        cd locale-list
        git pull
        cd ..
else
        git clone https://github.com/umpirsky/locale-list.git
fi

cp -a country-list/data/en_GB/*.{json,csv,yaml,php} ./data
cp -a currency-list/data/en_GB/*.{json,csv,yaml,php} ./data
cp -a language-list/data/en_GB/*.{json,csv,yaml,php} ./data
cp -a locale-list/data/en_GB/*.{json,csv,yaml,php} ./data

