updated bash script to delete build folders

This commit is contained in:
Nishant Srivastava
2019-11-29 03:21:55 +01:00
parent 73a4a19496
commit 9e742c5655

View File

@ -23,16 +23,11 @@
echo " 🗑 Deleting build directories..."
# Iterate over each sub-directory inside the current directory
for DIR in ./*;
# Find all directories with name "build" inside the current directory, recursively
for FOUND_BUILD_DIR in $(find . -type d -name "build");
do
# Check if build directory exists inside the $DIR directory
BUILD_DIR="$DIR/build/"
if [ -d $BUILD_DIR ]; then
echo " > Deleting build directory inside " "$DIR"
# Run the trash command on build directory
trash $BUILD_DIR
fi
# Run the trash command on found build directory
trash $FOUND_BUILD_DIR
done
echo " ✔️ Done."