Skip to content

Instantly share code, notes, and snippets.

@rezaiyan
Created July 3, 2021 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rezaiyan/5025d0dc09f5058a192bb7b535036755 to your computer and use it in GitHub Desktop.
Save rezaiyan/5025d0dc09f5058a192bb7b535036755 to your computer and use it in GitHub Desktop.
#!/bin/bash
#hi
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for rootFolder in */ ; do
if [ -d $rootFolder"build" ]; then
echo "do you want to delete build folders of \"${rootFolder%?}\" project?"
read ans
if [ "$ans" = "y" ] || [ "$ans" = "Y" ]; then
rm -rf $rootFolder"build"
for innerFolder in $rootFolder*/ ; do
if [ -d $innerFolder"build" ]; then
rm -rf $innerFolder"build"
fi;
done
fi
fi
done
IFS=$SAVEIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment