Skip to content

Commit 9e742c5

Browse files
committed
updated bash script to delete build folders
1 parent 73a4a19 commit 9e742c5

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

delete_build_folder.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@
2323

2424
echo " 🗑 Deleting build directories..."
2525

26-
# Iterate over each sub-directory inside the current directory
27-
for DIR in ./*;
26+
# Find all directories with name "build" inside the current directory, recursively
27+
for FOUND_BUILD_DIR in $(find . -type d -name "build");
2828
do
29-
# Check if build directory exists inside the $DIR directory
30-
BUILD_DIR="$DIR/build/"
31-
if [ -d $BUILD_DIR ]; then
32-
echo " > Deleting build directory inside " "$DIR"
33-
# Run the trash command on build directory
34-
trash $BUILD_DIR
35-
fi
29+
# Run the trash command on found build directory
30+
trash $FOUND_BUILD_DIR
3631
done
3732

3833
echo " ✔️ Done."

0 commit comments

Comments
 (0)