From d8d0cc0898e4e0232ea94ac78a007686a9123bf6 Mon Sep 17 00:00:00 2001 From: Nishant Srivastava Date: Thu, 20 Jun 2019 07:41:34 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20add=20script=20to=20get=20packag?= =?UTF-8?q?es=20for=20all=20projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_packages.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 get_packages.sh diff --git a/get_packages.sh b/get_packages.sh new file mode 100755 index 0000000..bbfffd2 --- /dev/null +++ b/get_packages.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Written by Nishant Srivastava + +# Call as +# ./get_packages.sh + +echo "# Updating to 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 + # Update the packages in the project + echo "" + echo ">>>> Get packages for " "$DIR" + # Run `flutter packages get` command inside the sub-directory i.e Flutter project + (cd "$DIR" && flutter packages get); + echo "" + echo ">>>> Done." + fi +done \ No newline at end of file