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