mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-07-04 01:17:08 +08:00
updated bash script to get packages
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
# Call as
|
# Call as
|
||||||
# ./get_packages.sh
|
# ./get_packages.sh
|
||||||
|
|
||||||
echo "# Updating to packages..."
|
echo " ‣ Updating packages..."
|
||||||
|
|
||||||
# Iterate over each sub-directory inside the current directory
|
# Iterate over each sub-directory inside the current directory
|
||||||
for DIR in ./*;
|
for DIR in ./*;
|
||||||
@ -12,12 +12,18 @@ do
|
|||||||
# Check if pubspec.yaml file exists inside the $DIR directory
|
# Check if pubspec.yaml file exists inside the $DIR directory
|
||||||
# If it does then it is a Flutter project
|
# If it does then it is a Flutter project
|
||||||
if [ -f "$DIR/pubspec.yaml" ]; then
|
if [ -f "$DIR/pubspec.yaml" ]; then
|
||||||
# Update the packages in the project
|
# Navigate into the sub directory
|
||||||
echo ""
|
cd "$DIR"
|
||||||
echo ">>>> Get packages for " "$DIR"
|
|
||||||
# Run `flutter packages get` command inside the sub-directory i.e Flutter project
|
# Run `flutter packages get` command inside the sub-directory i.e Flutter project
|
||||||
(cd "$DIR" && flutter packages get);
|
flutter packages get | grep "FAILED"
|
||||||
echo ""
|
|
||||||
echo ">>>> Done."
|
# 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
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo " ✔️ Done."
|
Reference in New Issue
Block a user