Files
flame/scripts/format.sh
Erick 2259587b04 Moving tutorials to the Flame main repository (#720)
* Moving tutorials to the Flame main repository

* Update README.md

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* Upgraded scripts to support multi projects

* Removed comment out code

* Adding WIP disclaimer

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-03-23 19:38:09 -03:00

27 lines
509 B
Bash
Executable File

#!/usr/bin/env bash
function run_format() {
FORMAT_ISSUES=$(flutter format --set-exit-if-changed -n .)
if [ $? -eq 1 ]; then
echo "flutter format issues on"
echo $FORMAT_ISSUES
exit 1
fi
}
echo "Starting Flame Formatter"
echo "------------------------"
for file in $(find . -type f -name "pubspec.yaml"); do
dir=$(dirname $file)
cd $dir
echo "Formatting $dir"
run_format
format_result=$?
if [ $format_result -ne 0 ]; then
exit $format_result
fi
cd $(cd -)
done
exit 0