2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-22 10:10:12 +00:00
vinyldns/build/deep_clean.sh

16 lines
486 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
#
# This script will delete all target/ directories and the assembly/ directory
#
set -euo pipefail
DIR=$(
cd "$(dirname "$0")"
pwd -P
)
echo "Performing deep clean"
find "${DIR}/.." -type d -name target -o -name assembly | while read -r p; do if [ -d "$p" ]; then
echo -n "Removing $(realpath --relative-to="$DIR" "$p").." && \
{ { rm -rf "$p" &> /dev/null && echo "done."; } || { echo -e "\e[93mERROR\e[0m: you may need to be root"; exit 1; } }
fi; done