set -Eeuo pipefail
build_dir="$(pwd)/build"
APP_NAME="Project build cleaner"
function print_help() {
script_name="$(basename "$0")"
echo -e ""
echo -e "$APP_NAME - Removes everything within the build dir."
echo -e ""
echo -e "Usage:"
echo -e "\t$script_name"
echo -e "Options:"
echo -e "\t-h, --help"
echo -e "\t\tPrint this usage help and exit"
echo -e "Examples:"
echo -e "\t$script_name"
echo -e ""
}
while [[ $# -gt 0 ]]
do
arg="$1"
shift
case "$arg" in
-h|--help)
print_help
exit 0
;;
-*) >&2 echo "ERROR: Unknown switch '$arg'"
exit 1
;;
*) POSITIONAL+=("$arg") ;;
esac
done
set -- "${POSITIONAL[@]}"
if [ -d "$build_dir" ]
then
rm -Rf "${build_dir:?}/"*
fi