1#!/usr/bin/env bash 2 3set -e 4 5echo "Checking if current directory is a Git repo and deleting it if so" 6 7if [ -z "$CI" ]; then 8 echo "CI environment variable is not set. Refusing to clean repo because it'll delete everything" 9 echo "You might not enjoy that." 10 exit 1 11fi 12 13if [ -d .git ]; then 14 echo ".git folder exists. Cleaning up directory." 15 find . -maxdepth 1 ! -path . -print0 | xargs -0 rm -rf 16fi