Skip to content

Instantly share code, notes, and snippets.

@abbas-oveissi
Created January 17, 2018 17:21
Show Gist options
  • Save abbas-oveissi/2d85b8178c11952ae8960392d834b03a to your computer and use it in GitHub Desktop.
Save abbas-oveissi/2d85b8178c11952ae8960392d834b03a 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