Skip to content

Commit a9d2759

Browse files
committed
🚧 updated delete build directory script
1 parent b21f842 commit a9d2759

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

delete_build_folder.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77
# Install trash cli
88
# brew install trash
99

10-
# Iterate over each child directory inside the current directory
11-
echo ""
12-
for dir in ./*;
10+
echo "# Deleting build directories..."
11+
12+
# Iterate over each sub-directory inside the current directory
13+
for DIR in ./*;
1314
do
14-
echo ""
15-
echo ">>>> Deleting build directory inside " $dir
16-
trash $dir/build/
17-
echo ""
18-
echo ">>>> Done."
15+
# Check if build directory exists inside the $DIR directory
16+
# If it does then it is a Flutter project
17+
if [ -d "$DIR/build/" ]; then
18+
# Update the packages in the project
19+
echo ""
20+
echo ">>>> Deleting build directory inside " "$DIR"
21+
# Run command inside the sub-directory i.e Flutter project
22+
(cd "$DIR" && trash build);
23+
echo ""
24+
echo ">>>> Done."
25+
fi
1926
done

0 commit comments

Comments
 (0)