#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
#Clear terminal screen so the about text can be read
clear
RED='\033[31m'
GREEN='\033[32m'
YELLOW='\033[33m'
RESET='\033[0m'
# TODO
# Check if using bash
# if test -z "$BASH_VERSION";
# then
# printf "Using ${GREEN}$BASH_VERSION of bash, continuing.\n${RESET}"
# else
# printf "${RED}Please run this script using bash, not sh or any other shell.\n${RESET}"
# exit 1
# fi
#Extract a new Drupal 8 tar
curl -L https://www.drupal.org/download-latest/tar.gz | tar -xz --strip-components=1
#curl -L https://www.drupal.org/download-latest/tar.gz | tar -xz --strip-components=1
wait
printf "
${GREEN}
####
# This simple script starts a Drupal 8 checked out from head.
#
####
${RESET}"
while true; do
read -p "Continue? (y/n): " INSTALL
case $INSTALL in
[Yy]* ) printf "${GREEN}# Continuing \n#### \n${RESET}"; break;;
[Nn]* ) exit;;
* ) echo "Please answer y or n.";;
esac
done
php core/scripts/drupal quick-start
printf "
${GREEN}