set -e docker info > /dev/null 2>&1 # Ensure that Docker is running... if [ $? -ne 0 ]; then echo "Docker is not running." exit 1 fi if [ -d 'example-app' ]; then echo "Cannot create app because a directory of the same name already exists in this directory." exit 1 fi if [ -f 'example-app' ]; then echo "Cannot create app because a file of the same name already exists in this directory." exit 1 fi if [ -d ".xftemp" ]; then rm -rf ".xftemp" fi mkdir ".xftemp" cd ".xftemp" curl -L https://github.com/shannah/docker-compose-xataface/archive/refs/heads/master.zip > master.zip unzip -q master.zip mv docker-compose-xataface-master ../'example-app' cd ../'example-app' cp sample.env .env sed -i -e 's/COMPOSER_TEMPLATE_NAME=.*/COMPOSER_TEMPLATE_NAME=xataface\/example\-app\:dev\-master/g' .env sed -i -e 's/COMPOSE_PROJECT_NAME=example\-app/COMPOSE_PROJECT_NAME=example\-app/g' .env echo "Configuring docker container..." (bash configure.sh) echo "Finished configuring docker container" CYAN='\033[0;36m' LIGHT_CYAN='\033[1;36m' WHITE='\033[1;37m' NC='\033[0m' echo "" if sudo -n true 2>/dev/null; then sudo chown -R $USER: . echo -e "${WHITE}Get started with:${NC} cd 'example-app' && bin/start" else echo -e "${WHITE}Please provide your password so we can make some final adjustments to your application's permissions.${NC}" echo "" sudo chown -R $USER: . echo "" echo -e "${WHITE}Thank you! We hope you build something incredible. Dive in with:${NC} cd 'example-app' && bin/start" fi