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