Skip to content

Instantly share code, notes, and snippets.

@sergiocasero
Created February 3, 2021 07:42
Show Gist options
  • Save sergiocasero/3ae4b18bf865bc53bf7dd41bf3b64447 to your computer and use it in GitHub Desktop.
Save sergiocasero/3ae4b18bf865bc53bf7dd41bf3b64447 to your computer and use it in GitHub Desktop.
This is a quite simple script that cleans all your grade/flutter projects inside a folder

Works on linux and macOS (and linux inside Windows)

  1. Download the script (or copy paste it)
  2. Put the script in the same folder than your projects
  3. chmod +x your_script_name.sh, if you didn't change the name => `chmod +x projects_cleaner.sh
  4. ./projects_cleaner.sh
  5. Wait and enjoy!!

If you find this gist helpful, don't forget the star! :)

!#/bin/bash
for d in */ ; do
cd $d
if [ -f "pubspec.yaml" ]; then
echo "$d is a flutter project"
flutter clean
else
echo "$d is a gradle project"
./gradlew clean
fi
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment