This repository has been archived on 2022-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
Marlin-Artillery-M600/buildroot/bin/format_code
2020-06-06 04:04:35 -05:00

30 lines
439 B
Bash
Executable file

#!/usr/bin/env bash
#
# format_code [dir/file...]
#
HERE=`dirname $0`
while [[ $# -gt 0 ]]; do
val="$1"
if [ -d "$val" ]; then
find $val -name *.cpp -exec "$HERE/uncrust" '{}' \;
elif [ -d "./Marlin/src/$val" ]; then
find "./Marlin/src/$val" -name *.cpp -exec "$HERE/uncrust" '{}' \;
elif [ -f "./Marlin/src/$val" ]; then
uncrust "./Marlin/src/$val"
elif [ -f "$val" ]; then
uncrust "$val"
fi
done