-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathget_packages.sh
More file actions
executable file
·29 lines (22 loc) · 719 Bytes
/
get_packages.sh
File metadata and controls
executable file
·29 lines (22 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Written by Nishant Srivastava
# Call as
# ./get_packages.sh
echo " ‣ Updating packages..."
# Iterate over each sub-directory inside the current directory
for DIR in ./*;
do
# Check if pubspec.yaml file exists inside the $DIR directory
# If it does then it is a Flutter project
if [ -f "$DIR/pubspec.yaml" ]; then
# Navigate into the sub directory
cd "$DIR"
# Run `flutter packages get` command inside the sub-directory i.e Flutter project
flutter packages get | grep "FAILED"
# Print the name of the sub directory when done
echo "$DIR" | awk -F'/' '{print $2}' | xargs -I{} echo " ↪️ {} ✔️"
# Go back to parent directory
cd ../
fi
done
echo " ✔️ Done."