Skip to content

Commit d8d0cc0

Browse files
committed
🚧 add script to get packages for all projects
1 parent 291876b commit d8d0cc0

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

get_packages.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# Written by Nishant Srivastava
3+
4+
# Call as
5+
# ./get_packages.sh
6+
7+
echo "# Updating to packages..."
8+
9+
# Iterate over each sub-directory inside the current directory
10+
for DIR in ./*;
11+
do
12+
# Check if pubspec.yaml file exists inside the $DIR directory
13+
# If it does then it is a Flutter project
14+
if [ -f "$DIR/pubspec.yaml" ]; then
15+
# Update the packages in the project
16+
echo ""
17+
echo ">>>> Get packages for " "$DIR"
18+
# Run `flutter packages get` command inside the sub-directory i.e Flutter project
19+
(cd "$DIR" && flutter packages get);
20+
echo ""
21+
echo ">>>> Done."
22+
fi
23+
done

0 commit comments

Comments
 (0)