diff --git a/build/local/build.sh b/build/local/build.sh index ca1ac4a9dd..999691aade 100755 --- a/build/local/build.sh +++ b/build/local/build.sh @@ -186,12 +186,15 @@ init() { if [ -d tmp ]; then echo "Removing stale files and directories..." if [ -d "tmp/pmm-server" ]; then - tmp_files=$(find tmp/pmm-server | grep -v "RPMS") + tmp_files=$(find tmp/pmm-server | grep -v "RPMS" | grep -Ev "^tmp/pmm-server$") tmp_files=($tmp_files) for f in "${tmp_files[@]}"; do rm -rf "$f" done fi + if [ -d "tmp/source/pmm" ]; then + rm -rf tmp/source/pmm + fi fi if [ -f "$LOG_FILE" ]; then echo "Removing the log file..."