Skip to content

Instantly share code, notes, and snippets.

Created September 15, 2019 13:00
  • Star 66 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Flutter Clean Recursive - Clear up space on your hard drive by cleaning your Flutter projects. This script searches for all Flutter projects in this directory and all subdirectories and runs 'flutter clean'. Note: may take a long time for folders with large amounts of projects.
# To run, download the script or copy the code to a '.sh' file (for example '') and run like any other script:
# sh ./
# or
# sudo sh
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)"
echo "Looking for projects... (may take a while)"
find . -name "pubspec.yaml" -exec $SHELL -c '
echo "Done. Cleaning all projects."
for i in "$@" ; do
DIR=$(dirname "${i}")
echo "Cleaning ${DIR}..."
(cd "$DIR" && flutter clean >/dev/null 2>&1)
echo "DONE!"
' {} +
Copy link

This is awesome. Thanks

Copy link

zuril88 commented Oct 20, 2022

Thank you. Just what I was looking for

Copy link

hacker1024 commented Oct 25, 2022

Thanks for this. This script can be added as a Nix package (e.g. to environment.systemPackages) like so:

(pkgs.writeScriptBin "fltr-clean-recursive"
  (builtins.readFile "${fetchgit {
    url = "";
    sha256 = "0r80cxmr80kbh1l7qc5g4pq6yys8a7nq4xsybfx1xc9d6h0i7gqn";

Copy link

this is beautiful!

Copy link

peterjohnson427 commented Oct 3, 2023

House Washing Sunshine Coast is the favored option for outdoor cleaning services among Sunshine Coast residents and surrounding areas. Our pledge is to achieve outstanding results for all your driveway cleaning demands, no matter their magnitude or intricacy, utilizing our diverse range of cutting-edge equipment and advanced pressure washing methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment